--------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\data\RRP-APSR-Replication-2017-04-04\RRP-APSR-ReplicationCode-Main-2017-04-04.log
  log type:  text
 opened on:   4 Apr 2017, 23:12:39

. 
. clear

. clear matrix

. set more off

. 
. version 14.2

. 
. 
. ****************************************************************************************
. *
. * Reese, Ruby and Pape 
. *
. * "Days of Action or Restraint? How the Islamic Calendar Impacts Violence"
. *
. * Main Article Analysis Replication Code
. * 
. * April 4, 2017
. *
. ****************************************************************************************
. 
. 
. 
. ****************************************************************************************
. * Figure 2
. ****************************************************************************************
. 
. 
. ** Prepare data file by appending and labeling cases
. 
. *Afghanistan
. clear

. use "RRP-APSR-RepData-2017-04-04-AFG.dta"

. gen case = "Afghanistan"

. rename rcname province

. rename ctwits wits // NCTC-WITS Attacks

. rename ctgtd gtd // START-GTD Attacks

. rename ctsigact siga // SIGACT Events

. keep case gdate gyear gday gnummnth hyear hnummnth hday wits gtd siga 

. save "temp2.dta", replace
(note: file temp2.dta not found)
file temp2.dta saved

. 
. *Iraq
. use "RRP-APSR-RepData-2017-04-04-IRQ.dta"

. gen case = "Iraq"

. rename ctwits wits // NCTC-WITS Attacks

. rename ctgtd gtd // START-GTD Attacks

. rename ctibc ibc // Iraq Body Count

. keep case gdate gyear gday gnummnth hyear hnummnth hday wits gtd ibc 

. save "temp1.dta", replace
(note: file temp1.dta not found)
file temp1.dta saved

. 
. *Pakistan
. clear

. use "RRP-APSR-RepData-2017-04-04-PAK.dta"

. gen case = "Pakistan"

. rename prov province

. rename ctwits wits // NCTC-WITS Attacks

. rename ctgtd gtd // START-GTD Attacks

. rename ctpips pips // PIPS Attacks

. keep case province gdate gyear gnummnth gday hyear hnummnth hday wits gtd pips 

. append using "temp1.dta"

. append using "temp2.dta"
(note: variable case was str8, now str11 to accommodate using data's values)

. label var province "Province"

. label var case "Case"

. label var gyear "Gregorian Year" 

. label var gnummnth "Gregorian Month"

. label var gday "Gregorian Day"

. label var hyear "Hijri Year"

. label var hnummnth "Hijri Month"

. label var hday "Hijri Day"

. erase "temp1.dta"

. erase "temp2.dta"

. 
. **Aggregation
. 
. *Aggregate attacks to Case-Gregorian Date from Case-Province-Gregorian Date
. collapse ///
> (first) gyear gnummnth gday hyear hnummnth hday ///
> (sum) wits  ///
> (sum) gtd ///
> (sum) ibc ///
> (sum) siga ///
> (sum) pips ///
> , by (case gdate)

. save "temp1.dta", replace
(note: file temp1.dta not found)
file temp1.dta saved

. 
. *Aggregate to Hijri Year Month
. collapse ///
> (sum) wits  ///
> (sum) gtd ///
> (sum) ibc ///
> (sum) siga ///
> (sum) pips ///
> , by (case hyear hnummnth)

. save "temp2.dta", replace
(note: file temp2.dta not found)
file temp2.dta saved

. 
. *Create Gregorian to Hijri Date Lookup 
. clear

. use "temp1.dta"

. keep case gdate gyear gday gnummnth hyear hnummnth hday

. merge m:1 case hyear hnummnth using temp2.dta

    Result                           # of obs.
    -----------------------------------------
    not matched                             0
    matched                            12,054  (_merge==3)
    -----------------------------------------

. erase "temp1.dta"

. erase "temp2.dta"

. label var case "Case"

. label var gyear "Gregorian Year" 

. label var gnummnth "Gregorian Month"

. label var gday "Gregorian Day"

. label var hyear "Hijri Year"

. label var hnummnth "Hijri Month"

. label var hday "Hijri Day"

. label var wits "WITS"

. label var gtd "GTD"

. label var ibc "IBC"

. label var siga "SIGACTs"

. label var pips "PIPS"

. 
. *Convert gdate from string to date
. gen gdated = date(gdate, "MDY")

. format %tdNN/DD/CCYY gdated

. drop gdate

. rename gdated gdate

. 
. *WITS Jan 2004 to Dec 2011
. replace wits = . if gdate >date("20111231","YMD")
(3,288 real changes made, 3,288 to missing)

. 
. *IBC Jan 2004 to June 2009 in Iraq
. replace ibc = . if gdate >= date("20090701","YMD") & case == "Iraq"
(2,010 real changes made, 2,010 to missing)

. replace ibc = . if case != "Iraq"
(8,036 real changes made, 8,036 to missing)

. 
. *SIGACTS Jan 2008 - Dec 2014 in Afghanistan
. replace siga = . if gdate <= date("20071231","YMD") & case == "Afghanistan"
(1,461 real changes made, 1,461 to missing)

. replace siga = . if case != "Afghanistan"
(8,036 real changes made, 8,036 to missing)

. 
. *PIPS in Pakistan
. replace pips = . if case != "Pakistan"
(8,036 real changes made, 8,036 to missing)

. 
. sort case gdate  

. 
. *Drop incomplete Hijri Months from beginning and end of each dataset since these
. *will give appearance of false decline aggregating to Hijri Month Year.
. 
. replace gtd = . if hyear==1424 & hnummnth==11 // begin GTD
(67 real changes made, 67 to missing)

. replace gtd = . if hyear==1436 & hnummnth==3 // end GTD
(26 real changes made, 26 to missing)

. replace wits = . if hyear==1424 & hnummnth==11 // begin WITS
(67 real changes made, 67 to missing)

. replace wits = . if hyear==1433 & hnummnth==2 // end WITS
(17 real changes made, 17 to missing)

. replace pips = . if hyear==1424 & hnummnth==11 & case == "Pakistan" // begin PIPS
(23 real changes made, 23 to missing)

. replace pips = . if hyear==1436 & hnummnth==3 & case == "Pakistan" // end PIPS
(8 real changes made, 8 to missing)

. replace ibc = . if hyear==1424 & hnummnth==11 & case=="Iraq" // begin IBC
(22 real changes made, 22 to missing)

. replace ibc = . if hyear==1430 & hnummnth==7 & case=="Iraq" // end IBC
(7 real changes made, 7 to missing)

. replace siga = . if hyear==1436 & hnummnth==3 & case == "Afghanistan" // end SIGACTs
(9 real changes made, 9 to missing)

. replace siga = . if hyear==1428 & hnummnth==12 & case=="Afghanistan" // beginning SIGACT
(8 real changes made, 8 to missing)

. by case: gene daynum=_n

. 
. ***Figure EPS Export
. 
. set scheme s1color

. 
. **Color
. 
. *Afghanistan Color
. twoway (line wits daynum if case == "Afghanistan", lwidth(medthick) lcolor(green)) ///
> (line gtd daynum if case == "Afghanistan", lwidth(medthick)) ///
> (line siga daynum if case == "Afghanistan", xaxis(2) lwidth(medthick) yaxis(2)), ///
> title("AFGHANISTAN", position(11) size(vlarge)) ///
> legend(label(1 "WITS") label(2 "GTD") label(3 "SIGACTs (Secondary Axis)") ring(0) position(10) rows(3)) /// 
> changes legend series labels, places them in the drawing region, and forces them to one column
> ylabel(, labsize(large)) ///
> ylabel(, labsize(large) axis(2)) ///
> xtick(51 406 761 1115 1469 1823 2178 2532 2887 3241 3596 3950, axis(1) tl(*2)) ///
> xline(51 406 761 1115 1469 1823 2178 2532 2887 3241 3596 3950, axis(1) lcolor(gs10)) ///
> xtick(0 366 731 1096 1461 1827 2192 2557  2922 3288  3653 4018, axis(2) tl(*2)) ///
> xlabel(228 "1425" 583 "1426" 938 "1427" 1292 "1428" 1646 "1429" 2000 "1430" 2355 "1431" 2709 " 1431" 3064 "1
> 432" 3418 "1433" 3773 "1434", axis(1) labsize(large) notick) ///
> xlabel(183 "2004" 549 "2005" 914 "2006" 1279 "2007"     1644 "2008"     2010 "2009"     2375 "2010"     2740
>  "2011"     3105 "2012"     3471 "2013"     3836 "2014", axis(2) labsize(large) notick) ///
> xtitle("Hijri Calendar", axis(1) size(large) margin(top)) ///
> xtitle("Gregorian Calendar", axis(2) size(medlarge) margin(bottom)) ///
> ytitle("Violent Events", size(large)) ytitle("", axis(2)) ///
> ysize(2.25) xsize(6.5)

. graph export "RRP-Fig2-AFG-Color.eps", replace
(note: file RRP-Fig2-AFG-Color.eps not found)
(file RRP-Fig2-AFG-Color.eps written in EPS format)

. 
. *Iraq Color
. twoway (line wits daynum if case == "Iraq", xaxis(1) lwidth(medthick) lcolor(green)) ///
> (line gtd daynum if case == "Iraq", xaxis(1) lwidth(medthick)) ///
> (line ibc daynum if case == "Iraq", xaxis(2) lwidth(medthick)), ///
> title("IRAQ", position(11) size(vlarge)) ///
> legend(label(1 "WITS") label(2 "GTD") label(3 "IBC") ring(0) position(10) rows(3)) /// changes legend series
>  labels, places them in the drawing region, and forces them to one column
> xtick(51 406 761 1115 1469 1823 2178 2532 2887 3241 3596 3950, axis(1) tl(*2)) ///
> xline(51 406 761 1115 1469 1823 2178 2532 2887 3241 3596 3950, axis(1) lcolor(gs10)) ///
> xtick(0 366 731 1096 1461 1827 2192 2557  2922 3288  3653 4018, axis(2) tl(*2)) ///
> xlabel(228 "1425" 583 "1426" 938 "1427" 1292 "1428" 1646 "1429" 2000 "1430" 2355 "1431" 2709 " 1431" 3064 "1
> 432" 3418 "1433" 3773 "1434", axis(1) labsize(large) notick) ///
> xlabel(183 "2004" 549 "2005" 914 "2006" 1279 "2007"     1644 "2008"     2010 "2009"     2375 "2010"     2740
>  "2011"     3105 "2012"     3471 "2013"     3836 "2014", axis(2) labsize(large) notick) ///
> ylabel(, labsize(large)) ///
> xtitle("Hijri Calendar", axis(1) size(large) margin(top)) ///
> xtitle("Gregorian Calendar", axis(2) size(large) margin(bottom)) ///
> ytitle("Violent Events", size(large)) ///
> ysize(2.25) xsize(6.5)

. graph export "RRP-Fig2-IRQ-Color.eps", replace
(note: file RRP-Fig2-IRQ-Color.eps not found)
(file RRP-Fig2-IRQ-Color.eps written in EPS format)

. 
. *Pakistan Color
. twoway (line wits daynum if case == "Pakistan", lwidth(medthick) lcolor(green)) ///
> (line gtd daynum if case == "Pakistan", lwidth(medthick)) ///
> (line pips daynum if case == "Pakistan", xaxis(2) lwidth(medthick)), ///
> title("PAKISTAN", position(11) size(vlarge)) /// 
> legend(label(1 "WITS") label(2 "GTD") label(3 "PIPS") ring(0) position(10) rows(3)) /// changes legend serie
> s labels, places them in the drawing region, and forces them to one column
> xtick(51 406 761 1115 1469 1823 2178 2532 2887 3241 3596 3950, axis(1) tl(*2)) ///
> xline(51 406 761 1115 1469 1823 2178 2532 2887 3241 3596 3950, axis(1) lcolor(gs10)) ///
> xtick(0 366 731 1096 1461 1827 2192 2557  2922 3288  3653 4018, axis(2) tl(*2)) ///
> xlabel(228 "1425" 583 "1426" 938 "1427" 1292 "1428" 1646 "1429" 2000 "1430" 2355 "1431" 2709 " 1431" 3064 "1
> 432" 3418 "1433" 3773 "1434", axis(1) labsize(large) notick) ///
> xlabel(183 "2004" 549 "2005" 914 "2006" 1279 "2007"     1644 "2008"     2010 "2009"     2375 "2010"     2740
>  "2011"     3105 "2012"     3471 "2013"     3836 "2014", axis(2) labsize(large) notick) ///
> ylabel(, labsize(medlarge)) ///
> xtitle("Hijri Calendar", axis(1) size(large) margin(top)) ///
> xtitle("Gregorian Calendar", axis(2) size(large) margin(bottom)) ///
> ytitle("Violent Events", size(large)) ///
> ysize(2.25) xsize(6.5)

. graph export "RRP-Fig2-PAK-Color.eps", replace
(note: file RRP-Fig2-PAK-Color.eps not found)
(file RRP-Fig2-PAK-Color.eps written in EPS format)

. 
. **Grayscale
. 
. *Afghanistan Grayscale
. twoway (line wits daynum if case == "Afghanistan", lwidth(medthick) lcolor(black) lpattern(solid)) ///
> (line gtd daynum if case == "Afghanistan", lwidth(medthick) lcolor(gray) lpattern(solid)) ///
> (line siga daynum if case == "Afghanistan", xaxis(2) lwidth(medthick) lcolor(black) lpattern(dash) yaxis(2))
> , ///
> title("AFGHANISTAN", position(11) size(vlarge)) ///
> legend(label(1 "WITS") label(2 "GTD") label(3 "SIGACTs (Secondary Axis)") ring(0) position(10) rows(3)) /// 
> changes legend series labels, places them in the drawing region, and forces them to one column
> ylabel(, labsize(large)) ///
> ylabel(, labsize(large) axis(2)) ///
> xtick(51 406 761 1115 1469 1823 2178 2532 2887 3241 3596 3950, axis(1) tl(*2)) ///
> xline(51 406 761 1115 1469 1823 2178 2532 2887 3241 3596 3950, axis(1) lcolor(gs10)) ///
> xtick(0 366 731 1096 1461 1827 2192 2557  2922 3288  3653 4018, axis(2) tl(*2)) ///
> xlabel(228 "1425" 583 "1426" 938 "1427" 1292 "1428" 1646 "1429" 2000 "1430" 2355 "1431" 2709 " 1431" 3064 "1
> 432" 3418 "1433" 3773 "1434", axis(1) labsize(large) notick) ///
> xlabel(183 "2004" 549 "2005" 914 "2006" 1279 "2007"     1644 "2008"     2010 "2009"     2375 "2010"     2740
>  "2011"     3105 "2012"     3471 "2013"     3836 "2014", axis(2) labsize(large) notick) ///
> xtitle("Hijri Calendar", axis(1) size(large) margin(top)) ///
> xtitle("Gregorian Calendar", axis(2) size(large) margin(bottom)) ///
> ytitle("Violent Events", size(large)) ytitle("", axis(2)) ///
> ysize(2.25) xsize(6.5)

. graph export "RRP-Fig2-AFG-Grayscale.eps", replace
(note: file RRP-Fig2-AFG-Grayscale.eps not found)
(file RRP-Fig2-AFG-Grayscale.eps written in EPS format)

. 
. *Iraq Grayscale
. twoway (line wits daynum if case == "Iraq", lwidth(medthick) lcolor(black) lpattern(solid)) ///
> (line gtd daynum if case == "Iraq", lwidth(medthick) lcolor(gray) lpattern(solid)) ///
> (line ibc daynum if case == "Iraq", xaxis(2) lwidth(medthick) lcolor(black) lpattern(dash)), ///
> title("IRAQ", position(11) size(vlarge)) ///
> legend(label(1 "WITS") label(2 "GTD") label(3 "IBC") ring(0) position(10) rows(3)) /// changes legend series
>  labels, places them in the drawing region, and forces them to one column
> xtick(51 406 761 1115 1469 1823 2178 2532 2887 3241 3596 3950, axis(1) tl(*2)) ///
> xline(51 406 761 1115 1469 1823 2178 2532 2887 3241 3596 3950, axis(1) lcolor(gs10)) ///
> xtick(0 366 731 1096 1461 1827 2192 2557  2922 3288  3653 4018, axis(2) tl(*2)) ///
> xlabel(228 "1425" 583 "1426" 938 "1427" 1292 "1428" 1646 "1429" 2000 "1430" 2355 "1431" 2709 " 1431" 3064 "1
> 432" 3418 "1433" 3773 "1434", axis(1) labsize(large) notick) ///
> xlabel(183 "2004" 549 "2005" 914 "2006" 1279 "2007"     1644 "2008"     2010 "2009"     2375 "2010"     2740
>  "2011"     3105 "2012"     3471 "2013"     3836 "2014", axis(2) labsize(large) notick) ///
> ylabel(, labsize(medlarge)) ///
> xtitle("Hijri Calendar", axis(1) size(large) margin(top)) ///
> xtitle("Gregorian Calendar", axis(2) size(large) margin(bottom)) ///
> ytitle("Violent Events", size(large)) ///
> ysize(2.25) xsize(6.5)

. graph export "RRP-Fig2-IRQ-Grayscale.eps", replace
(note: file RRP-Fig2-IRQ-Grayscale.eps not found)
(file RRP-Fig2-IRQ-Grayscale.eps written in EPS format)

. 
. *Pakistan Grayscale
. twoway (line wits daynum if case == "Pakistan", lwidth(medthick) lcolor(black) lpattern(solid)) ///
> (line gtd daynum if case == "Pakistan", lwidth(medthick) lcolor(gray) lpattern(solid)) ///
> (line pips daynum if case == "Pakistan", xaxis(2) lwidth(medthick) lcolor(black) lpattern(dash)), ///
> title("PAKISTAN", position(11) size(vlarge)) ///
> legend(label(1 "WITS") label(2 "GTD") label(3 "PIPS") ring(0) position(10) rows(3)) /// changes legend serie
> s labels, places them in the drawing region, and forces them to one column
> xtick(51 406 761 1115 1469 1823 2178 2532 2887 3241 3596 3950, axis(1) tl(*2)) ///
> xline(51 406 761 1115 1469 1823 2178 2532 2887 3241 3596 3950, axis(1) lcolor(gs10)) ///
> xtick(0 366 731 1096 1461 1827 2192 2557  2922 3288  3653 4018, axis(2) tl(*2)) ///
> xlabel(228 "1425" 583 "1426" 938 "1427" 1292 "1428" 1646 "1429" 2000 "1430" 2355 "1431" 2709 " 1431" 3064 "1
> 432" 3418 "1433" 3773 "1434", axis(1) labsize(large) notick) ///
> xlabel(183 "2004" 549 "2005" 914 "2006" 1279 "2007"     1644 "2008"     2010 "2009"     2375 "2010"     2740
>  "2011"     3105 "2012"     3471 "2013"     3836 "2014", axis(2) labsize(large) notick) ///
> ylabel(, labsize(large)) ///
> xtitle("Hijri Calendar", axis(1) size(large) margin(top)) ///
> xtitle("Gregorian Calendar", axis(2) size(large) margin(bottom)) ///
> ytitle("Violent Events", size(large)) ///
> ysize(2.25) xsize(6.5)

. graph export "RRP-Fig2-PAK-Grayscale.eps", replace
(note: file RRP-Fig2-PAK-Grayscale.eps not found)
(file RRP-Fig2-PAK-Grayscale.eps written in EPS format)

. 
. 
. 
. ****************************************************************************************
. * Table 2
. ****************************************************************************************
. 
. 
. ***Afghanistan (Columns 1-3)
. 
. use RRP-APSR-RepData-2017-04-04-AFG.dta, clear

. 
. 
. **WITS (Column 1)
. 
. *N, Average, St. Dev.
. sum ctwits if gyear>=2004 & gyear<=2011, detail

                 WITS Attack Events (Count)
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%            0              0
10%            0              0       Obs              14,610
25%            0              0       Sum of Wgt.      14,610

50%            0                      Mean           .8405202
                        Largest       Std. Dev.      2.055337
75%            1             42
90%            2             43       Variance        4.22441
95%            3             47       Skewness       9.398501
99%            7             51       Kurtosis       148.1324

. local ntmp=r(N)

. 
. *Total Events
. display r(sum)
12280

. 
. *Zero-Days (and Percentage)
. quietly sum ctwits if ctwits==0 & gyear>=2004 & gyear<=2011, detail

. display r(N)
9045

. display r(N)/`ntmp'
.61909651

. 
. 
. **GTD (Column 2)
. 
. *N, Average, St. Dev.
. sum ctgtd if gyear>=2004 & gyear<=2014, detail

                  GTD Attack Events (Count)
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%            0              0
10%            0              0       Obs              20,090
25%            0              0       Sum of Wgt.      20,090

50%            0                      Mean           .3681434
                        Largest       Std. Dev.      .8843531
75%            0             17
90%            1             21       Variance       .7820803
95%            2             24       Skewness       6.193338
99%            4             27       Kurtosis        105.021

. local ntmp=r(N)

. 
. *Total Events
. display r(sum)
7396

. 
. *Zero-Days (and Percentage)
. quietly sum ctgtd if ctgtd==0 & gyear>=2004 & gyear<=2014, detail

. display r(N)
15393

. display r(N)/`ntmp'
.76620209

. 
. 
. **SIGACTs (Column 3)
. 
. *N, Average, St. Dev.
. sum ctsigact if gyear>=2008 & gyear<=2014, detail

                SIGACT Attack Events (Count)
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%            0              0
10%            0              0       Obs              12,785
25%            1              0       Sum of Wgt.      12,785

50%            4                      Mean           12.40211
                        Largest       Std. Dev.      16.88044
75%           20            219
90%           36            227       Variance       284.9493
95%           45            259       Skewness       2.578058
99%           70            261       Kurtosis       18.34497

. local ntmp=r(N)

. 
. *Total Events
. display r(sum)
158561

. 
. *Zero-Days (and Percentage)
. quietly sum ctsigact if ctsigact==0 & gyear>=2008 & gyear<=2014, detail

. display r(N)
2359

. display r(N)/`ntmp'
.1845131

. 
. 
. ***Iraq (Columns 4-6)
. 
. use RRP-APSR-RepData-2017-04-04-IRQ.dta, clear

. 
. 
. **WITS (Column 4)
. 
. *N, Average, St. Dev.
. sum ctwits if gyear>=2004 & gyear<=2011, detail

                 WITS Attack Events (Count)
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%            0              0
10%            0              0       Obs              52,596
25%            0              0       Sum of Wgt.      52,596

50%            0                      Mean           .5263518
                        Largest       Std. Dev.      1.365308
75%            0             19
90%            2             20       Variance       1.864065
95%            3             21       Skewness       4.553307
99%            7             21       Kurtosis        32.6545

. local ntmp=r(N)

. 
. *Total Events
. display r(sum)
27684

. 
. *Zero-Days (and Percentage)
. quietly sum ctwits if ctwits==0 & gyear>=2004 & gyear<=2011, detail

. display r(N)
40247

. display r(N)/`ntmp'
.76521028

. 
. 
. **GTD (Column 5)
. 
. *N, Average, St. Dev.
. sum ctgtd if gyear>=2004 & gyear<=2014, detail

                  GTD Attack Events (Count)
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%            0              0
10%            0              0       Obs              72,324
25%            0              0       Sum of Wgt.      72,324

50%            0                      Mean           .2159311
                        Largest       Std. Dev.       .823322
75%            0             20
90%            1             22       Variance       .6778591
95%            1             23       Skewness       8.089526
99%            4             33       Kurtosis       127.3951

. local ntmp=r(N)

. 
. *Total Events
. display r(sum)
15617

. 
. *Zero-Days (and Percentage)
. quietly sum ctgtd if ctgtd==0 & gyear>=2004 & gyear<=2014, detail

. display r(N)
63962

. display r(N)/`ntmp'
.88438139

. 
. 
. **IBC (Column 6)
. 
. *N, Average, St. Dev.
. sum ctibc if (gyear>=2004 & gyear<=2008) | (gyear==2009 & gnummnth<=6), detail

                  IBC Attack Events (Count)
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%            0              0
10%            0              0       Obs              36,144
25%            0              0       Sum of Wgt.      36,144

50%            0                      Mean           .5314852
                        Largest       Std. Dev.      1.598201
75%            0             27
90%            2             27       Variance       2.554248
95%            3             31       Skewness       6.704811
99%            7             40       Kurtosis       71.35565

. local ntmp=r(N)

. 
. *Total Events
. display r(sum)
19210

. 
. *Zero-Days (and Percentage)
. quietly sum ctibc if ctibc==0 & ((gyear>=2004 & gyear<=2008) | (gyear==2009 & gnummnth<=6)), detail

. display r(N)
27854

. display r(N)/`ntmp'
.77063966

. 
. 
. ***Pakistan (Columns 7-9)
. 
. use RRP-APSR-RepData-2017-04-04-PAK.dta, clear

. 
. 
. **WITS (Column 7)
. 
. *N, Average, St. Dev.
. sum ctwits if gyear>=2004 & gyear<=2011, detail

                 WITS Attack Events (Count)
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%            0              0
10%            0              0       Obs              23,376
25%            0              0       Sum of Wgt.      23,376

50%            0                      Mean           .3582307
                        Largest       Std. Dev.      .9342028
75%            0             11
90%            1             12       Variance       .8727348
95%            2             12       Skewness       4.124229
99%            4             15       Kurtosis       27.97833

. local ntmp=r(N)

. 
. *Total Events
. display r(sum)
8374

. 
. *Zero-Days (and Percentage)
. quietly sum ctwits if ctwits==0 & gyear>=2004 & gyear<=2011, detail

. display r(N)
18769

. display r(N)/`ntmp'
.80291752

. 
. 
. **GTD (Column 8)
. 
. *N, Average, St. Dev.
. sum ctgtd if gyear>=2004 & gyear<=2014, detail

                  GTD Attack Events (Count)
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%            0              0
10%            0              0       Obs              32,144
25%            0              0       Sum of Wgt.      32,144

50%            0                      Mean            .294674
                        Largest       Std. Dev.      .8599256
75%            0             12
90%            1             15       Variance        .739472
95%            2             27       Skewness       6.388207
99%            4             32       Kurtosis        113.153

. local ntmp=r(N)

. 
. *Total Events
. display r(sum)
9472

. 
. *Zero-Days (and Percentage)
. quietly sum ctgtd if ctgtd==0 & gyear>=2004 & gyear<=2014, detail

. display r(N)
26782

. display r(N)/`ntmp'
.83318815

. 
. 
. **PIPS (Column 9)
. 
. *N, Average, St. Dev.
. sum ctpips if gyear>=2004 & gyear<=2014, detail

                 PIPS Attack Events (Count)
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%            0              0
10%            0              0       Obs              32,144
25%            0              0       Sum of Wgt.      32,144

50%            0                      Mean           .5933922
                        Largest       Std. Dev.      1.243339
75%            1             13
90%            2             13       Variance       1.545893
95%            3             13       Skewness       2.959972
99%            6             13       Kurtosis        14.7376

. local ntmp=r(N)

. 
. *Total Events
. display r(sum)
19074

. 
. *Zero-Days (and Percentage)
. quietly sum ctpips if ctpips==0 & gyear>=2004 & gyear<=2014, detail

. display r(N)
23268

. display r(N)/`ntmp'
.7238676

. 
. 
. 
. ****************************************************************************************
. * Table 5
. ****************************************************************************************
. 
. 
. **Afghanistan Models
. 
. use RRP-APSR-RepData-2017-04-04-AFG.dta, clear

. 
. *Model 1
. nbreg ctwits drelph drelnph dsecph afgelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoina
> ctlg drcid2-drcid5 d2005-d2011 dayid ctwitslg if gyear>=2004 & gyear<=2011, robust nolog

Negative binomial regression                    Number of obs     =     14,605
                                                Wald chi2(25)     =    4428.17
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood = -14804.285               Pseudo R2         =     0.1777

------------------------------------------------------------------------------
             |               Robust
      ctwits |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      drelph |   -.184289   .0480829    -3.83   0.000    -.2785297   -.0900482
     drelnph |  -.0556945   .0356274    -1.56   0.118     -.125523     .014134
      dsecph |   .0442333   .1000247     0.44   0.658    -.1518114     .240278
  afgelect30 |   .2389645   .0771762     3.10   0.002     .0877019    .3902271
   uselect30 |   .0260556    .083625     0.31   0.755    -.1378465    .1899576
    oilprice |  -.0014638   .0016675    -0.88   0.380     -.004732    .0018044
  grainindex |   .0008017    .000832     0.96   0.335    -.0008289    .0024323
        temp |   .0160942   .0026412     6.09   0.000     .0109175     .021271
        wesd |  -.0186499   .0040731    -4.58   0.000     -.026633   -.0106668
      precip |  -.0145458   .0069784    -2.08   0.037    -.0282231   -.0008684
     tcloudc |  -.0014784   .0008288    -1.78   0.074    -.0031028     .000146
 ctcoinactlg |    .001075   .0015442     0.70   0.486    -.0019516    .0041016
      drcid2 |   2.719927    .069071    39.38   0.000     2.584551    2.855304
      drcid3 |   1.587685   .0741369    21.42   0.000      1.44238    1.732991
      drcid4 |   2.302117   .0751274    30.64   0.000      2.15487    2.449364
      drcid5 |   1.204241   .0683446    17.62   0.000     1.070288    1.338193
       d2005 |   1.183095   .1290524     9.17   0.000     .9301565    1.436033
       d2006 |   1.798861   .1761826    10.21   0.000     1.453549    2.144172
       d2007 |   1.843169   .2381237     7.74   0.000     1.376455    2.309883
       d2008 |   1.848449   .3120762     5.92   0.000     1.236791    2.460107
       d2009 |   2.399405   .3697528     6.49   0.000     1.674703    3.124107
       d2010 |   2.753664   .4354441     6.32   0.000     1.900209    3.607119
       d2011 |   2.612112    .520198     5.02   0.000     1.592543    3.631681
       dayid |   .0001338   .0001952     0.69   0.493    -.0002487    .0005164
    ctwitslg |   .0112199    .005476     2.05   0.040     .0004871    .0219528
       _cons |  -4.553549   .1530104   -29.76   0.000    -4.853444   -4.253654
-------------+----------------------------------------------------------------
    /lnalpha |  -.4152823   .0547486                     -.5225876    -.307977
-------------+----------------------------------------------------------------
       alpha |   .6601539   .0361425                      .5929842    .7349323
------------------------------------------------------------------------------

. 
. *Model 2
. nbreg ctgtd drelph drelnph dsecph afgelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinac
> tlg drcid2-drcid5 d2005-d2014 dayid ctgtdlg if gyear>=2004 & gyear<=2014, robust nolog

Negative binomial regression                    Number of obs     =     20,085
                                                Wald chi2(28)     =    4953.68
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood = -13074.786               Pseudo R2         =     0.1696

------------------------------------------------------------------------------
             |               Robust
       ctgtd |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      drelph |   -.290497   .0434991    -6.68   0.000    -.3757537   -.2052403
     drelnph |  -.0843053    .034535    -2.44   0.015    -.1519925    -.016618
      dsecph |  -.1078596   .1113343    -0.97   0.333    -.3260708    .1103515
  afgelect30 |   .5478645   .1357188     4.04   0.000     .2818607    .8138684
   uselect30 |   -.085393   .0662778    -1.29   0.198    -.2152951    .0445092
    oilprice |   .0024383   .0014563     1.67   0.094     -.000416    .0052927
  grainindex |  -.0021385   .0008269    -2.59   0.010    -.0037592   -.0005179
        temp |    .006778   .0023868     2.84   0.005        .0021    .0114559
        wesd |  -.0233697   .0040545    -5.76   0.000    -.0313164    -.015423
      precip |  -.0155826    .006658    -2.34   0.019     -.028632   -.0025332
     tcloudc |  -.0006334   .0007916    -0.80   0.424    -.0021849    .0009182
 ctcoinactlg |   .0035593   .0019821     1.80   0.073    -.0003256    .0074441
      drcid2 |   1.848343   .0711897    25.96   0.000     1.708814    1.987872
      drcid3 |   .8614789   .0774521    11.12   0.000     .7096756    1.013282
      drcid4 |   1.520968     .07208    21.10   0.000     1.379694    1.662243
      drcid5 |   .6268948    .074975     8.36   0.000     .4799466     .773843
       d2005 |   .5308666   .1547845     3.43   0.001     .2274946    .8342386
       d2006 |    1.17272   .1903344     6.16   0.000     .7996718    1.545769
       d2007 |   1.448734   .2438881     5.94   0.000      .970722    1.926746
       d2008 |   1.757305   .3288579     5.34   0.000     1.112756    2.401855
       d2009 |    1.86298   .3746499     4.97   0.000      1.12868    2.597281
       d2010 |   1.851355   .4336113     4.27   0.000     1.001492    2.701217
       d2011 |   1.780469   .5189089     3.43   0.001     .7634265    2.797512
       d2012 |   3.034196   .5906638     5.14   0.000     1.876516    4.191876
       d2013 |   2.988968    .651431     4.59   0.000     1.712187     4.26575
       d2014 |   3.226463   .7132998     4.52   0.000     1.828421    4.624505
       dayid |  -.0000243   .0001877    -0.13   0.897    -.0003921    .0003435
     ctgtdlg |   .0595728   .0144202     4.13   0.000     .0313097    .0878359
       _cons |  -3.987636   .1789917   -22.28   0.000    -4.338453   -3.636819
-------------+----------------------------------------------------------------
    /lnalpha |  -.6996893   .0995382                     -.8947805   -.5045981
-------------+----------------------------------------------------------------
       alpha |   .4967396   .0494445                      .4086973    .6037482
------------------------------------------------------------------------------

. 
. *Model 3
. nbreg ctsigact drelph drelnph dsecph afgelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoi
> nactlg drcid2-drcid5 d2009-d2014 dayid ctsigactlg if gyear>=2008 & gyear<=2014, robust nolog

Negative binomial regression                    Number of obs     =     12,780
                                                Wald chi2(24)     =   53180.71
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood = -31895.197               Pseudo R2         =     0.2720

------------------------------------------------------------------------------
             |               Robust
    ctsigact |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      drelph |  -.0974083   .0141505    -6.88   0.000    -.1251427   -.0696739
     drelnph |  -.0029875   .0122934    -0.24   0.808    -.0270822    .0211072
      dsecph |   .0712515   .0443246     1.61   0.108    -.0156232    .1581261
  afgelect30 |   .1923122   .0385448     4.99   0.000     .1167659    .2678585
   uselect30 |  -.0322877   .0229592    -1.41   0.160     -.077287    .0127115
    oilprice |   .0020009   .0004779     4.19   0.000     .0010642    .0029375
  grainindex |    -.00058   .0002372    -2.44   0.014     -.001045    -.000115
        temp |   .0012036   .0008064     1.49   0.136     -.000377    .0027841
        wesd |  -.0230256   .0012284   -18.75   0.000    -.0254331    -.020618
      precip |  -.0118117   .0022442    -5.26   0.000    -.0162103   -.0074131
     tcloudc |  -.0010419   .0002858    -3.65   0.000    -.0016022   -.0004817
 ctcoinactlg |   .0012706   .0010365     1.23   0.220    -.0007608    .0033021
      drcid2 |    3.14872   .0378821    83.12   0.000     3.074472    3.222968
      drcid3 |   1.497111   .0357453    41.88   0.000     1.427051    1.567171
      drcid4 |   3.153027   .0437833    72.01   0.000     3.067214    3.238841
      drcid5 |   1.595463   .0336456    47.42   0.000     1.529519    1.661407
       d2009 |   .3021662   .0328031     9.21   0.000     .2378733    .3664591
       d2010 |   .3901326   .0470886     8.29   0.000     .2978406    .4824245
       d2011 |   .2495038   .0668246     3.73   0.000       .11853    .3804775
       d2012 |   .1632264    .086901     1.88   0.060    -.0070963    .3335492
       d2013 |    .132995   .1071515     1.24   0.215    -.0770181    .3430082
       d2014 |    -.06143   .1281877    -0.48   0.632    -.3126732    .1898133
       dayid |   .0004089   .0000586     6.98   0.000     .0002941    .0005237
  ctsigactlg |   .0185904   .0008367    22.22   0.000     .0169505    .0202302
       _cons |  -1.710013   .1224829   -13.96   0.000    -1.950075   -1.469951
-------------+----------------------------------------------------------------
    /lnalpha |  -2.145455   .0544515                     -2.252178   -2.038732
-------------+----------------------------------------------------------------
       alpha |   .1170148   .0063716                      .1051699    .1301937
------------------------------------------------------------------------------

. 
. 
. **Iraq Models
. 
. use RRP-APSR-RepData-2017-04-04-IRQ.dta, clear

. 
. *Model 4
. nbreg ctwits drelph drelnph dsecph irqelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoina
> ctlg dprovid2-dprovid18 d2005-d2011 dayid ctwitslg if gyear>=2004 & gyear<=2011, robust nolog

Negative binomial regression                    Number of obs     =     52,578
                                                Wald chi2(38)     =   25324.86
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood = -33419.049               Pseudo R2         =     0.2958

------------------------------------------------------------------------------
             |               Robust
      ctwits |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      drelph |  -.4170196   .0261294   -15.96   0.000    -.4682323    -.365807
     drelnph |  -.0138591   .0182468    -0.76   0.448    -.0496222    .0219039
      dsecph |  -.0680933   .0217707    -3.13   0.002    -.1107631   -.0254236
  irqelect30 |   .0937473   .0477146     1.96   0.049     .0002284    .1872662
   uselect30 |   .1137526   .0425214     2.68   0.007     .0304121    .1970931
    oilprice |   .0035759   .0009203     3.89   0.000     .0017722    .0053796
  grainindex |  -.0020602   .0004642    -4.44   0.000    -.0029699   -.0011505
        temp |   .0034715   .0009736     3.57   0.000     .0015634    .0053796
        wesd |  -.0001484   .0068746    -0.02   0.983    -.0136225    .0133256
      precip |   -.001343   .0024805    -0.54   0.588    -.0062048    .0035187
     tcloudc |  -.0005613   .0004285    -1.31   0.190    -.0014011    .0002786
 ctcoinactlg |  -.0051389   .0022017    -2.33   0.020    -.0094541   -.0008237
    dprovid2 |  -.1419959     .04258    -3.33   0.001    -.2254512   -.0585406
    dprovid3 |   1.449829   .0375031    38.66   0.000     1.376325    1.523334
    dprovid4 |  -.8892711   .0511276   -17.39   0.000    -.9894793   -.7890629
    dprovid5 |  -4.871073   .3135179   -15.54   0.000    -5.485557   -4.256589
    dprovid6 |   .6409883    .037853    16.93   0.000     .5667977    .7151789
    dprovid7 |  -3.453111   .1440383   -23.97   0.000    -3.735421   -3.170801
    dprovid8 |  -2.098157   .0907537   -23.12   0.000    -2.276031   -1.920283
    dprovid9 |  -2.531829   .1065916   -23.75   0.000    -2.740745   -2.322914
   dprovid10 |  -3.421372   .1554015   -22.02   0.000    -3.725953    -3.11679
   dprovid11 |  -2.512438   .1006447   -24.96   0.000    -2.709698   -2.315178
   dprovid12 |    .868885   .0372411    23.33   0.000     .7958938    .9418762
   dprovid13 |  -2.326929   .0904759   -25.72   0.000    -2.504258   -2.149599
   dprovid14 |    .204136   .0403268     5.06   0.000     .1250968    .2831751
   dprovid15 |     -3.546   .1617384   -21.92   0.000    -3.863001   -3.228998
   dprovid16 |    .388574   .0379286    10.24   0.000     .3142352    .4629128
   dprovid17 |  -2.876924   .1195795   -24.06   0.000    -3.111295   -2.642552
   dprovid18 |  -1.484576   .0632404   -23.48   0.000    -1.608525   -1.360627
       d2005 |      1.058     .06409    16.51   0.000     .9323859    1.183614
       d2006 |   1.565092   .0866077    18.07   0.000     1.395345     1.73484
       d2007 |   1.602759   .1112729    14.40   0.000     1.384668     1.82085
       d2008 |   1.014627   .1416523     7.16   0.000     .7369933     1.29226
       d2009 |   .7297689    .171001     4.27   0.000     .3946131    1.064925
       d2010 |   .6513458   .2003485     3.25   0.001     .2586699    1.044022
       d2011 |   .4902506   .2341746     2.09   0.036     .0312768    .9492244
       dayid |    .000156   .0000882     1.77   0.077    -.0000168    .0003288
    ctwitslg |     .08107   .0038978    20.80   0.000     .0734304    .0887095
       _cons |  -2.646014   .3042813    -8.70   0.000    -3.242394   -2.049633
-------------+----------------------------------------------------------------
    /lnalpha |  -1.024089   .0404593                     -1.103388   -.9447904
-------------+----------------------------------------------------------------
       alpha |   .3591234   .0145299                      .3317452     .388761
------------------------------------------------------------------------------

. 
. *Model 5
. nbreg ctgtd drelph drelnph dsecph irqelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinac
> tlg dprovid2-dprovid18 d2005-d2014 dayid ctgtdlg if gyear>=2004 & gyear<=2014, robust nolog

Negative binomial regression                    Number of obs     =     72,306
                                                Wald chi2(41)     =    9911.39
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood = -26993.354               Pseudo R2         =     0.2604

------------------------------------------------------------------------------
             |               Robust
       ctgtd |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      drelph |  -.3729555    .038545    -9.68   0.000    -.4485024   -.2974086
     drelnph |   .0578427   .0278056     2.08   0.038     .0033447    .1123408
      dsecph |   .0129137   .0337237     0.38   0.702    -.0531835    .0790109
  irqelect30 |   .0317856   .0531255     0.60   0.550    -.0723386    .1359097
   uselect30 |  -.0876049   .0653358    -1.34   0.180    -.2156607    .0404509
    oilprice |   .0101898   .0012945     7.87   0.000     .0076527    .0127269
  grainindex |  -.0020794   .0006718    -3.10   0.002     -.003396   -.0007627
        temp |  -.0034836   .0013248    -2.63   0.009    -.0060802    -.000887
        wesd |   .0012462   .0127958     0.10   0.922    -.0238332    .0263256
      precip |  -.0041119   .0039582    -1.04   0.299    -.0118697     .003646
     tcloudc |   .0003835   .0006152     0.62   0.533    -.0008224    .0015893
 ctcoinactlg |   -.003414   .0019879    -1.72   0.086    -.0073103    .0004823
    dprovid2 |  -.6399369   .0594654   -10.76   0.000    -.7564869   -.5233869
    dprovid3 |   1.253183   .0421951    29.70   0.000     1.170482    1.335884
    dprovid4 |  -1.781585     .09209   -19.35   0.000    -1.962078   -1.601091
    dprovid5 |  -7.243381   1.001646    -7.23   0.000     -9.20657   -5.280191
    dprovid6 |   .2492912   .0469134     5.31   0.000     .1573427    .3412398
    dprovid7 |  -3.683691   .2594978   -14.20   0.000    -4.192298   -3.175085
    dprovid8 |  -2.406094   .1177517   -20.43   0.000    -2.636883   -2.175305
    dprovid9 |  -3.913319   .2093835   -18.69   0.000    -4.323704   -3.502935
   dprovid10 |  -4.712475   .3141999   -15.00   0.000    -5.328295   -4.096654
   dprovid11 |  -3.347162    .165258   -20.25   0.000    -3.671061   -3.023262
   dprovid12 |      .2445   .0455531     5.37   0.000     .1552175    .3337825
   dprovid13 |  -3.951541    .236742   -16.69   0.000    -4.415547   -3.487535
   dprovid14 |   .2206749   .0474459     4.65   0.000     .1276827    .3136671
   dprovid15 |  -4.092554   .2189073   -18.70   0.000    -4.521604   -3.663503
   dprovid16 |  -.1216429    .052771    -2.31   0.021     -.225072   -.0182137
   dprovid17 |  -3.326466   .1673528   -19.88   0.000    -3.654472   -2.998461
   dprovid18 |  -2.484573    .124187   -20.01   0.000    -2.727975   -2.241171
       d2005 |   .3479101   .0994469     3.50   0.000     .1529979    .5428224
       d2006 |   .3731971   .1291411     2.89   0.004     .1200853     .626309
       d2007 |   .5636757   .1665483     3.38   0.001     .2372469    .8901044
       d2008 |   .4048656   .2182475     1.86   0.064    -.0228916    .8326228
       d2009 |   .5552498   .2531598     2.19   0.028     .0590657    1.051434
       d2010 |   .2658441   .2964639     0.90   0.370    -.3152146    .8469027
       d2011 |   .0786968   .3510554     0.22   0.823    -.6093591    .7667527
       d2012 |   .1711554   .3979092     0.43   0.667    -.6087324    .9510432
       d2013 |   .6226468    .441049     1.41   0.158    -.2417934    1.487087
       d2014 |   .8316014   .4833283     1.72   0.085    -.1157046    1.778907
       dayid |   .0003402   .0001289     2.64   0.008     .0000875    .0005929
     ctgtdlg |   .1368537   .0097747    14.00   0.000     .1176957    .1560117
       _cons |  -1.696567   .3991693    -4.25   0.000    -2.478925   -.9142099
-------------+----------------------------------------------------------------
    /lnalpha |   .2478586   .0328799                      .1834152     .312302
-------------+----------------------------------------------------------------
       alpha |   1.281279   .0421283                      1.201313    1.366567
------------------------------------------------------------------------------

. 
. *Model 6
. nbreg ctibc drelph drelnph dsecph irqelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinac
> tlg dprovid2-dprovid18 d2005-d2009 dayid ctibclg if (gyear>=2004 & gyear<=2008) | (gyear==2009 & gnummnth<=6
> ), robust nolog

Negative binomial regression                    Number of obs     =     36,126
                                                Wald chi2(36)     =   20390.34
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood = -22282.872               Pseudo R2         =     0.3069

------------------------------------------------------------------------------
             |               Robust
       ctibc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      drelph |  -.3514358   .0297804   -11.80   0.000    -.4098042   -.2930674
     drelnph |   .0102637   .0217236     0.47   0.637    -.0323137    .0528411
      dsecph |  -.0515002   .0257092    -2.00   0.045    -.1018892   -.0011111
  irqelect30 |   .0188486   .0639512     0.29   0.768    -.1064935    .1441908
   uselect30 |   .2127272   .0497043     4.28   0.000     .1153086    .3101458
    oilprice |   .0008773   .0012282     0.71   0.475      -.00153    .0032846
  grainindex |   .0005891   .0006363     0.93   0.355     -.000658    .0018362
        temp |   .0023922   .0012598     1.90   0.058     -.000077    .0048614
        wesd |   .0057225   .0091922     0.62   0.534    -.0122938    .0237388
      precip |  -.0059526   .0028069    -2.12   0.034     -.011454   -.0004512
     tcloudc |  -.0016276   .0005316    -3.06   0.002    -.0026695   -.0005856
 ctcoinactlg |   .0001499   .0013959     0.11   0.914    -.0025859    .0028858
    dprovid2 |   .2166788   .0476054     4.55   0.000     .1233739    .3099838
    dprovid3 |   1.734173   .0436736    39.71   0.000     1.648575    1.819772
    dprovid4 |  -.6906792   .0616114   -11.21   0.000    -.8114353   -.5699231
    dprovid5 |  -5.137639   .5332722    -9.63   0.000    -6.182833   -4.092444
    dprovid6 |   .9229883   .0417432    22.11   0.000     .8411732    1.004803
    dprovid7 |  -3.113709   .1655187   -18.81   0.000     -3.43812   -2.789298
    dprovid8 |  -1.901688   .0975283   -19.50   0.000     -2.09284   -1.710536
    dprovid9 |   -2.03241   .1042237   -19.50   0.000    -2.236685   -1.828136
   dprovid10 |  -3.173028   .1898239   -16.72   0.000    -3.545076    -2.80098
   dprovid11 |  -1.993824   .1067235   -18.68   0.000    -2.202999    -1.78465
   dprovid12 |   .9321144   .0436289    21.36   0.000     .8466034    1.017625
   dprovid13 |  -1.592113   .0865074   -18.40   0.000    -1.761664   -1.422562
   dprovid14 |   .3362774    .047815     7.03   0.000     .2425617     .429993
   dprovid15 |  -3.285927   .1785803   -18.40   0.000    -3.635938   -2.935916
   dprovid16 |   .1600478    .047511     3.37   0.001      .066928    .2531676
   dprovid17 |  -2.869845   .1514405   -18.95   0.000    -3.166663   -2.573028
   dprovid18 |  -.5492819   .0596392    -9.21   0.000    -.6661726   -.4323912
       d2005 |   .8443734   .0769653    10.97   0.000     .6935241    .9952226
       d2006 |   1.688278   .1097577    15.38   0.000     1.473157    1.903399
       d2007 |   1.839986   .1404616    13.10   0.000     1.564686    2.115285
       d2008 |   1.180301   .1735232     6.80   0.000     .8402018      1.5204
       d2009 |    .786609   .2055268     3.83   0.000     .3837838    1.189434
       dayid |  -.0001199   .0001142    -1.05   0.294    -.0003437    .0001039
     ctibclg |   .0754847   .0038968    19.37   0.000     .0678471    .0831223
       _cons |  -2.756071   .3945969    -6.98   0.000    -3.529467   -1.982676
-------------+----------------------------------------------------------------
    /lnalpha |  -1.334537    .060372                     -1.452864    -1.21621
-------------+----------------------------------------------------------------
       alpha |   .2632801   .0158947                      .2338995    .2963513
------------------------------------------------------------------------------

. 
. 
. **Pakistan Models
. 
. use RRP-APSR-RepData-2017-04-04-PAK.dta, clear

. 
. *Model 7
. nbreg ctwits drelph drelnph dsecph pakelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoina
> ctlg dproid2-dproid8 d2005-d2011 dayid ctwitslg if gyear>=2004 & gyear<=2011, robust nolog

Negative binomial regression                    Number of obs     =     23,368
                                                Wald chi2(28)     =    5179.73
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood = -12668.728               Pseudo R2         =     0.2698

------------------------------------------------------------------------------
             |               Robust
      ctwits |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      drelph |    -.33733   .1085874    -3.11   0.002    -.5501574   -.1245026
     drelnph |   .0019445   .0303159     0.06   0.949    -.0574737    .0613626
      dsecph |  -.0160498    .037866    -0.42   0.672    -.0902658    .0581662
  pakelect30 |   .0062098   .0910346     0.07   0.946    -.1722148    .1846344
   uselect30 |  -.1818779   .0813116    -2.24   0.025    -.3412457   -.0225101
    oilprice |  -.0057818    .001481    -3.90   0.000    -.0086845   -.0028792
  grainindex |   .0026666   .0007413     3.60   0.000     .0012137    .0041195
        temp |   .0044373   .0025824     1.72   0.086     -.000624    .0094987
        wesd |  -.0053948   .0042485    -1.27   0.204    -.0137216    .0029321
      precip |  -.0054437   .0034826    -1.56   0.118    -.0122695    .0013822
     tcloudc |   .0010598   .0007657     1.38   0.166     -.000441    .0025606
 ctcoinactlg |   .0076493   .0017834     4.29   0.000     .0041539    .0111447
     dproid2 |   5.985957   .5286317    11.32   0.000     4.949857    7.022056
     dproid3 |   .1045269   .6673974     0.16   0.876    -1.203548    1.412602
     dproid4 |   5.535375   .5289792    10.46   0.000     4.498595    6.572155
     dproid5 |   2.406359   .5448965     4.42   0.000     1.338381    3.474337
     dproid6 |   3.980698   .5321842     7.48   0.000     2.937636     5.02376
     dproid7 |   5.972445   .5295247    11.28   0.000     4.934596    7.010294
     dproid8 |    4.34022   .5317614     8.16   0.000     3.297987    5.382454
       d2005 |   1.315392   .1403371     9.37   0.000     1.040336    1.590447
       d2006 |   1.271455   .1739021     7.31   0.000     .9306132    1.612297
       d2007 |   2.112496   .2075928    10.18   0.000     1.705621     2.51937
       d2008 |   2.750299   .2643687    10.40   0.000     2.232146    3.268452
       d2009 |   2.807361    .313524     8.95   0.000     2.192865    3.421857
       d2010 |   2.769861   .3643317     7.60   0.000     2.055784    3.483938
       d2011 |   2.969275   .4238181     7.01   0.000     2.138607    3.799943
       dayid |  -.0003319   .0001566    -2.12   0.034    -.0006389   -.0000249
    ctwitslg |   .1509642   .0093278    16.18   0.000      .132682    .1692464
       _cons |  -8.134029   .5452785   -14.92   0.000    -9.202755   -7.065303
-------------+----------------------------------------------------------------
    /lnalpha |  -.7053084   .0632717                     -.8293187   -.5812981
-------------+----------------------------------------------------------------
       alpha |   .4939562   .0312535                      .4363465     .559172
------------------------------------------------------------------------------

. 
. *Model 8
. nbreg ctgtd drelph drelnph dsecph pakelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoinac
> tlg dproid2-dproid8 d2005-d2014 dayid ctgtdlg if gyear>=2004 & gyear<=2014, robust nolog

Negative binomial regression                    Number of obs     =     32,136
                                                Wald chi2(31)     =    6069.35
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood = -15345.781               Pseudo R2         =     0.2675

------------------------------------------------------------------------------
             |               Robust
       ctgtd |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      drelph |  -.3611314   .1129717    -3.20   0.001    -.5825518    -.139711
     drelnph |   .0006902   .0293704     0.02   0.981    -.0568748    .0582552
      dsecph |  -.0498758   .0374321    -1.33   0.183    -.1232414    .0234898
  pakelect30 |    .359967   .0728245     4.94   0.000     .2172336    .5027003
   uselect30 |  -.0461764   .0709188    -0.65   0.515    -.1851747     .092822
    oilprice |  -.0030114   .0013954    -2.16   0.031    -.0057463   -.0002765
  grainindex |     .00047   .0007314     0.64   0.520    -.0009634    .0019035
        temp |  -.0009822   .0021398    -0.46   0.646    -.0051761    .0032117
        wesd |   .0019357   .0042044     0.46   0.645    -.0063046    .0101761
      precip |  -.0139337   .0042661    -3.27   0.001    -.0222951   -.0055724
     tcloudc |   .0007666   .0007434     1.03   0.302    -.0006905    .0022237
 ctcoinactlg |   .0047021   .0022569     2.08   0.037     .0002787    .0091255
     dproid2 |   4.414105    .205911    21.44   0.000     4.010527    4.817683
     dproid3 |  -1.872088   .4921142    -3.80   0.000    -2.836614   -.9075623
     dproid4 |   3.962185   .2096405    18.90   0.000     3.551297    4.373073
     dproid5 |   .8578626   .2410143     3.56   0.000     .3854833    1.330242
     dproid6 |   2.367071   .2190718    10.80   0.000     1.937698    2.796443
     dproid7 |   4.218265   .2117993    19.92   0.000     3.803146    4.633384
     dproid8 |   3.747352   .2155628    17.38   0.000     3.324857    4.169848
       d2005 |   .2271491   .2059322     1.10   0.270    -.1764706    .6307687
       d2006 |   1.025744   .2125143     4.83   0.000      .609224    1.442265
       d2007 |   1.471009     .23062     6.38   0.000     1.019002    1.923015
       d2008 |   2.245491   .2883276     7.79   0.000      1.68038    2.810603
       d2009 |   2.397879   .3181354     7.54   0.000     1.774345    3.021413
       d2010 |   2.561446    .371452     6.90   0.000     1.833413    3.289478
       d2011 |   2.986246   .4362569     6.85   0.000     2.131198    3.841294
       d2012 |   3.449092   .4879447     7.07   0.000     2.492738    4.405446
       d2013 |   3.667856    .531153     6.91   0.000     2.626815    4.708897
       d2014 |   3.732032   .5806213     6.43   0.000     2.594035    4.870029
       dayid |  -.0000747   .0001481    -0.50   0.614    -.0003649    .0002155
     ctgtdlg |   .1013798   .0113778     8.91   0.000     .0790797    .1236799
       _cons |   -7.17364   .2748493   -26.10   0.000    -7.712335   -6.634945
-------------+----------------------------------------------------------------
    /lnalpha |  -.4690815   .0721261                     -.6104462   -.3277169
-------------+----------------------------------------------------------------
       alpha |   .6255766   .0451204                      .5431085     .720567
------------------------------------------------------------------------------

. 
. *Model 9
. nbreg ctpips drelph drelnph dsecph pakelect30 uselect30 oilprice grainindex temp wesd precip tcloudc ctcoina
> ctlg dproid2-dproid8 d2005-d2014 dayid ctpipslg if gyear>=2004 & gyear<=2014, robust nolog

Negative binomial regression                    Number of obs     =     32,136
                                                Wald chi2(31)     =    9803.86
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood =  -21824.22               Pseudo R2         =     0.3233

------------------------------------------------------------------------------
             |               Robust
      ctpips |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      drelph |  -.5290489   .0820687    -6.45   0.000    -.6899006   -.3681972
     drelnph |  -.0151747   .0190386    -0.80   0.425    -.0524897    .0221403
      dsecph |    .030826   .0227522     1.35   0.175    -.0137675    .0754195
  pakelect30 |   .1988985    .056711     3.51   0.000      .087747    .3100501
   uselect30 |  -.0734887   .0472603    -1.55   0.120    -.1661171    .0191398
    oilprice |  -.0011046   .0008248    -1.34   0.180    -.0027211     .000512
  grainindex |   .0003277   .0004264     0.77   0.442     -.000508    .0011634
        temp |   .0025964   .0014278     1.82   0.069    -.0002021    .0053948
        wesd |   .0001009   .0027923     0.04   0.971    -.0053718    .0055736
      precip |  -.0052853   .0027829    -1.90   0.058    -.0107396     .000169
     tcloudc |   .0012559   .0004876     2.58   0.010     .0003002    .0022117
 ctcoinactlg |    .007052   .0011601     6.08   0.000     .0047781    .0093258
     dproid2 |   3.805058   .1253108    30.36   0.000     3.559453    4.050662
     dproid3 |   .3163449   .1559577     2.03   0.043     .0106733    .6220164
     dproid4 |   3.673195   .1275963    28.79   0.000      3.42311    3.923279
     dproid5 |  -.3413542   .1776945    -1.92   0.055    -.6896291    .0069206
     dproid6 |     1.5255   .1377729    11.07   0.000      1.25547     1.79553
     dproid7 |   3.719908   .1294311    28.74   0.000     3.466228    3.973588
     dproid8 |   3.050808   .1307501    23.33   0.000     2.794543    3.307074
       d2005 |   .0152498    .434949     0.04   0.972    -.8372345    .8677341
       d2006 |   2.660181   .3189428     8.34   0.000     2.035064    3.285297
       d2007 |   4.448043   .3215254    13.83   0.000     3.817864    5.078221
       d2008 |   4.768261   .3377183    14.12   0.000     4.106345    5.430177
       d2009 |   4.847598    .352353    13.76   0.000     4.156999    5.538197
       d2010 |   4.718516   .3714496    12.70   0.000     3.990488    5.446544
       d2011 |   4.643182   .3965056    11.71   0.000     3.866045    5.420318
       d2012 |   4.354788   .4198983    10.37   0.000     3.531802    5.177773
       d2013 |   4.394019     .44473     9.88   0.000     3.522364    5.265674
       d2014 |   4.131816   .4708374     8.78   0.000     3.208992     5.05464
       dayid |   .0002486   .0000983     2.53   0.011     .0000559    .0004413
    ctpipslg |   .1220847   .0051881    23.53   0.000     .1119162    .1322532
       _cons |  -8.639341   .3335179   -25.90   0.000    -9.293024   -7.985658
-------------+----------------------------------------------------------------
    /lnalpha |  -1.418162   .0555828                     -1.527102   -1.309221
-------------+----------------------------------------------------------------
       alpha |   .2421588   .0134599                      .2171641    .2700303
------------------------------------------------------------------------------

. 
. 
. 
. ****************************************************************************************
. * Table 6
. ****************************************************************************************
. 
. 
. ***Afghanistan Models
. 
. use RRP-APSR-RepData-2017-04-04-AFG.dta, clear

. 
. 
. **Model 1
. 
. clear matrix

. set seed 323

. quietly generate drope=.

. order drope

. estsimp nbreg ctwits drelph drelnph dsecph afgelect30 uselect30 oilprice grainindex temp wesd precip tcloudc
>  ctcoinactlg drcid2-drcid5 d2005-d2011 dayid ctwitslg if gyear>=2004 & gyear<=2011, robust nolog

Negative binomial regression                    Number of obs     =     14,605
                                                Wald chi2(25)     =    4428.17
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood = -14804.285               Pseudo R2         =     0.1777

------------------------------------------------------------------------------
             |               Robust
      ctwits |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      drelph |   -.184289   .0480829    -3.83   0.000    -.2785297   -.0900482
     drelnph |  -.0556945   .0356274    -1.56   0.118     -.125523     .014134
      dsecph |   .0442333   .1000247     0.44   0.658    -.1518114     .240278
  afgelect30 |   .2389645   .0771762     3.10   0.002     .0877019    .3902271
   uselect30 |   .0260556    .083625     0.31   0.755    -.1378465    .1899576
    oilprice |  -.0014638   .0016675    -0.88   0.380     -.004732    .0018044
  grainindex |   .0008017    .000832     0.96   0.335    -.0008289    .0024323
        temp |   .0160942   .0026412     6.09   0.000     .0109175     .021271
        wesd |  -.0186499   .0040731    -4.58   0.000     -.026633   -.0106668
      precip |  -.0145458   .0069784    -2.08   0.037    -.0282231   -.0008684
     tcloudc |  -.0014784   .0008288    -1.78   0.074    -.0031028     .000146
 ctcoinactlg |    .001075   .0015442     0.70   0.486    -.0019516    .0041016
      drcid2 |   2.719927    .069071    39.38   0.000     2.584551    2.855304
      drcid3 |   1.587685   .0741369    21.42   0.000      1.44238    1.732991
      drcid4 |   2.302117   .0751274    30.64   0.000      2.15487    2.449364
      drcid5 |   1.204241   .0683446    17.62   0.000     1.070288    1.338193
       d2005 |   1.183095   .1290524     9.17   0.000     .9301565    1.436033
       d2006 |   1.798861   .1761826    10.21   0.000     1.453549    2.144172
       d2007 |   1.843169   .2381237     7.74   0.000     1.376455    2.309883
       d2008 |   1.848449   .3120762     5.92   0.000     1.236791    2.460107
       d2009 |   2.399405   .3697528     6.49   0.000     1.674703    3.124107
       d2010 |   2.753664   .4354441     6.32   0.000     1.900209    3.607119
       d2011 |   2.612112    .520198     5.02   0.000     1.592543    3.631681
       dayid |   .0001338   .0001952     0.69   0.493    -.0002487    .0005164
    ctwitslg |   .0112199    .005476     2.05   0.040     .0004871    .0219528
       _cons |  -4.553549   .1530104   -29.76   0.000    -4.853444   -4.253654
-------------+----------------------------------------------------------------
    /lnalpha |  -.4152823   .0547486                     -.5225876    -.307977
-------------+----------------------------------------------------------------
       alpha |   .6601539   .0361425                      .5929842    .7349323
------------------------------------------------------------------------------

Simulating main parameters.  Please wait....
% of simulations completed: 3% 7% 11% 14% 18% 22% 25% 29% 33% 37% 40% 44% 48% 51% 55% 59% 62% 66% 70% 74% 77% 
> 81% 85% 88% 92% 96% 100% 

Number of simulations  : 1000
Names of new variables : b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 b18 b19 b20 b21 b22 b23 b2
> 4 b25 b26 b27

. quietly generate dropb=.

. order dropb

. setx mean

. setx drelph 0 drelnph 0 dsecph 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local hbase=r(mean)

. quietly drop expval

. setx drelph 1 drelnph 0 dsecph 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Both Religious Day and Public Holiday"
. display (r(mean)-`hbase')/`hbase'
-.16801466

. *
. quietly drop expval

. setx mean

. setx afgelect30 0 uselect30 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local pbase=r(mean)

. quietly drop expval

. setx afgelect30 1 uselect30 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Afghan Election within 30 Days"
. display (r(mean)-`pbase')/`pbase'
.27238881

. *
. quietly drop expval

. setx mean

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local cbase=r(mean)

. quietly drop expval

. quietly summarize temp if gyear>=2004 & gyear<=2011, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx temp `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Mean Temp +1 SD"
. display (r(mean)-`cbase')/`cbase'
.17327828

. *
. quietly drop expval

. setx mean

. quietly summarize wesd if gyear>=2004 & gyear<=2011, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx wesd `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Mean Snow Cover +1 SD"
. display (r(mean)-`cbase')/`cbase'
-.12779695

. *
. quietly drop expval

. setx mean

. quietly summarize precip if gyear>=2004 & gyear<=2011, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx precip `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Mean Precipitation +1 SD"
. display (r(mean)-`cbase')/`cbase'
-.0387637

. *
. quietly drop expval

. quietly drop dropb-drope

. 
. **Model 2
. 
. clear matrix

. set seed 323

. quietly generate drope=.

. order drope

. estsimp nbreg ctgtd drelph drelnph dsecph afgelect30 uselect30 oilprice grainindex temp wesd precip tcloudc 
> ctcoinactlg drcid2-drcid5 d2005-d2014 dayid ctgtdlg if gyear>=2004 & gyear<=2014, robust nolog

Negative binomial regression                    Number of obs     =     20,085
                                                Wald chi2(28)     =    4953.68
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood = -13074.786               Pseudo R2         =     0.1696

------------------------------------------------------------------------------
             |               Robust
       ctgtd |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      drelph |   -.290497   .0434991    -6.68   0.000    -.3757537   -.2052403
     drelnph |  -.0843053    .034535    -2.44   0.015    -.1519925    -.016618
      dsecph |  -.1078596   .1113343    -0.97   0.333    -.3260708    .1103515
  afgelect30 |   .5478645   .1357188     4.04   0.000     .2818607    .8138684
   uselect30 |   -.085393   .0662778    -1.29   0.198    -.2152951    .0445092
    oilprice |   .0024383   .0014563     1.67   0.094     -.000416    .0052927
  grainindex |  -.0021385   .0008269    -2.59   0.010    -.0037592   -.0005179
        temp |    .006778   .0023868     2.84   0.005        .0021    .0114559
        wesd |  -.0233697   .0040545    -5.76   0.000    -.0313164    -.015423
      precip |  -.0155826    .006658    -2.34   0.019     -.028632   -.0025332
     tcloudc |  -.0006334   .0007916    -0.80   0.424    -.0021849    .0009182
 ctcoinactlg |   .0035593   .0019821     1.80   0.073    -.0003256    .0074441
      drcid2 |   1.848343   .0711897    25.96   0.000     1.708814    1.987872
      drcid3 |   .8614789   .0774521    11.12   0.000     .7096756    1.013282
      drcid4 |   1.520968     .07208    21.10   0.000     1.379694    1.662243
      drcid5 |   .6268948    .074975     8.36   0.000     .4799466     .773843
       d2005 |   .5308666   .1547845     3.43   0.001     .2274946    .8342386
       d2006 |    1.17272   .1903344     6.16   0.000     .7996718    1.545769
       d2007 |   1.448734   .2438881     5.94   0.000      .970722    1.926746
       d2008 |   1.757305   .3288579     5.34   0.000     1.112756    2.401855
       d2009 |    1.86298   .3746499     4.97   0.000      1.12868    2.597281
       d2010 |   1.851355   .4336113     4.27   0.000     1.001492    2.701217
       d2011 |   1.780469   .5189089     3.43   0.001     .7634265    2.797512
       d2012 |   3.034196   .5906638     5.14   0.000     1.876516    4.191876
       d2013 |   2.988968    .651431     4.59   0.000     1.712187     4.26575
       d2014 |   3.226463   .7132998     4.52   0.000     1.828421    4.624505
       dayid |  -.0000243   .0001877    -0.13   0.897    -.0003921    .0003435
     ctgtdlg |   .0595728   .0144202     4.13   0.000     .0313097    .0878359
       _cons |  -3.987636   .1789917   -22.28   0.000    -4.338453   -3.636819
-------------+----------------------------------------------------------------
    /lnalpha |  -.6996893   .0995382                     -.8947805   -.5045981
-------------+----------------------------------------------------------------
       alpha |   .4967396   .0494445                      .4086973    .6037482
------------------------------------------------------------------------------

Simulating main parameters.  Please wait....
% of simulations completed: 3% 6% 10% 13% 16% 20% 23% 26% 30% 33% 36% 40% 43% 46% 50% 53% 56% 60% 63% 66% 70% 
> 73% 76% 80% 83% 86% 90% 93% 96% 100% 

Number of simulations  : 1000
Names of new variables : b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 b18 b19 b20 b21 b22 b23 b2
> 4 b25 b26 b27 b28 b29 b30

. quietly generate dropb=.

. order dropb

. setx mean

. setx drelph 0 drelnph 0 dsecph 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local hbase=r(mean)

. quietly drop expval

. setx drelph 1 drelnph 0 dsecph 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Both Religious Day and Public Holiday"
. display (r(mean)-`hbase')/`hbase'
-.25191256

. *
. quietly drop expval

. setx drelph 0 drelnph 1 dsecph 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Both Religious Day and Not Public Holiday"
. display (r(mean)-`hbase')/`hbase'
-.08030028

. *
. quietly drop expval

. setx mean

. setx afgelect30 0 uselect30 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local pbase=r(mean)

. quietly drop expval

. setx afgelect30 1 uselect30 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Afghan Election within 30 Days"
. display (r(mean)-`pbase')/`pbase'
.74251048

. *
. quietly drop expval

. setx mean

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local cbase=r(mean)

. quietly drop expval

. quietly summarize grainindex if gyear>=2004 & gyear<=2014, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx grainindex `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Daily Grain Price Index +1 SD"
. display (r(mean)-`cbase')/`cbase'
-.12551455

. *
. quietly drop expval

. setx mean

. quietly summarize temp if gyear>=2004 & gyear<=2014, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx temp `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Mean Temp +1 SD"
. display (r(mean)-`cbase')/`cbase'
.07092343

. *
. quietly drop expval

. setx mean

. quietly summarize wesd if gyear>=2004 & gyear<=2014, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx wesd `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Mean Snow Cover +1 SD"
. display (r(mean)-`cbase')/`cbase'
-.15924151

. *
. quietly drop expval

. setx mean

. quietly summarize precip if gyear>=2004 & gyear<=2014, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx precip `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Mean Precipitation +1 SD"
. display (r(mean)-`cbase')/`cbase'
-.04282965

. *
. quietly drop expval

. quietly drop dropb-drope

. 
. **Model 3
. clear matrix

. set seed 323

. quietly generate drope=.

. order drope

. estsimp nbreg ctsigact drelph drelnph dsecph afgelect30 uselect30 oilprice grainindex temp wesd precip tclou
> dc ctcoinactlg drcid2-drcid5 d2009-d2014 dayid ctsigactlg if gyear>=2008 & gyear<=2014, robust nolog

Negative binomial regression                    Number of obs     =     12,780
                                                Wald chi2(24)     =   53180.71
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood = -31895.197               Pseudo R2         =     0.2720

------------------------------------------------------------------------------
             |               Robust
    ctsigact |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      drelph |  -.0974083   .0141505    -6.88   0.000    -.1251427   -.0696739
     drelnph |  -.0029875   .0122934    -0.24   0.808    -.0270822    .0211072
      dsecph |   .0712515   .0443246     1.61   0.108    -.0156232    .1581261
  afgelect30 |   .1923122   .0385448     4.99   0.000     .1167659    .2678585
   uselect30 |  -.0322877   .0229592    -1.41   0.160     -.077287    .0127115
    oilprice |   .0020009   .0004779     4.19   0.000     .0010642    .0029375
  grainindex |    -.00058   .0002372    -2.44   0.014     -.001045    -.000115
        temp |   .0012036   .0008064     1.49   0.136     -.000377    .0027841
        wesd |  -.0230256   .0012284   -18.75   0.000    -.0254331    -.020618
      precip |  -.0118117   .0022442    -5.26   0.000    -.0162103   -.0074131
     tcloudc |  -.0010419   .0002858    -3.65   0.000    -.0016022   -.0004817
 ctcoinactlg |   .0012706   .0010365     1.23   0.220    -.0007608    .0033021
      drcid2 |    3.14872   .0378821    83.12   0.000     3.074472    3.222968
      drcid3 |   1.497111   .0357453    41.88   0.000     1.427051    1.567171
      drcid4 |   3.153027   .0437833    72.01   0.000     3.067214    3.238841
      drcid5 |   1.595463   .0336456    47.42   0.000     1.529519    1.661407
       d2009 |   .3021662   .0328031     9.21   0.000     .2378733    .3664591
       d2010 |   .3901326   .0470886     8.29   0.000     .2978406    .4824245
       d2011 |   .2495038   .0668246     3.73   0.000       .11853    .3804775
       d2012 |   .1632264    .086901     1.88   0.060    -.0070963    .3335492
       d2013 |    .132995   .1071515     1.24   0.215    -.0770181    .3430082
       d2014 |    -.06143   .1281877    -0.48   0.632    -.3126732    .1898133
       dayid |   .0004089   .0000586     6.98   0.000     .0002941    .0005237
  ctsigactlg |   .0185904   .0008367    22.22   0.000     .0169505    .0202302
       _cons |  -1.710013   .1224829   -13.96   0.000    -1.950075   -1.469951
-------------+----------------------------------------------------------------
    /lnalpha |  -2.145455   .0544515                     -2.252178   -2.038732
-------------+----------------------------------------------------------------
       alpha |   .1170148   .0063716                      .1051699    .1301937
------------------------------------------------------------------------------

Simulating main parameters.  Please wait....
% of simulations completed: 3% 7% 11% 15% 19% 23% 26% 30% 34% 38% 42% 46% 50% 53% 57% 61% 65% 69% 73% 76% 80% 
> 84% 88% 92% 96% 100% 

Number of simulations  : 1000
Names of new variables : b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 b18 b19 b20 b21 b22 b23 b2
> 4 b25 b26

. quietly generate dropb=.

. order dropb

. setx mean

. setx drelph 0 drelnph 0 dsecph 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local hbase=r(mean)

. quietly drop expval

. setx drelph 1 drelnph 0 dsecph 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Both Religious Day and Public Holiday"
. display (r(mean)-`hbase')/`hbase'
-.09283725

. *
. quietly drop expval

. setx mean

. setx afgelect30 0 uselect30 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local pbase=r(mean)

. quietly drop expval

. setx afgelect30 1 uselect30 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Afghan Election within 30 Days"
. display (r(mean)-`pbase')/`pbase'
.21246088

. *
. quietly drop expval

. setx mean

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local cbase=r(mean)

. quietly drop expval

. quietly summarize oilprice if gyear>=2008 & gyear<=2014, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx oilprice `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Oil Price +1 SD"
. display (r(mean)-`cbase')/`cbase'
.04547257

. *
. quietly drop expval

. setx mean

. quietly summarize grainindex if gyear>=2008 & gyear<=2014, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx grainindex `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Daily Grain Price Index +1 SD"
. display (r(mean)-`cbase')/`cbase'
-.02183407

. *
. quietly drop expval

. setx mean

. quietly summarize wesd if gyear>=2008 & gyear<=2014, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx wesd `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Mean Snow Cover +1 SD"
. display (r(mean)-`cbase')/`cbase'
-.15728984

. *
. quietly drop expval

. setx mean

. quietly summarize precip if gyear>=2008 & gyear<=2014, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx precip `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Mean Precipitation +1 SD"
. display (r(mean)-`cbase')/`cbase'
-.03463445

. *
. quietly drop expval

. setx mean

. quietly summarize tcloudc if gyear>=2008 & gyear<=2014, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx tcloudc `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Mean Cloud Cover +1 SD"
. display (r(mean)-`cbase')/`cbase'
-.02214533

. *
. quietly drop expval

. quietly drop dropb-drope

. 
. 
. ***Iraq Models
. 
. use RRP-APSR-RepData-2017-04-04-IRQ.dta, clear

. 
. **Model 4
. clear matrix

. set seed 323

. quietly generate drope=.

. order drope

. estsimp nbreg ctwits drelph drelnph dsecph irqelect30 uselect30 oilprice grainindex temp wesd precip tcloudc
>  ctcoinactlg dprovid2-dprovid18 d2005-d2011 dayid ctwitslg if gyear>=2004 & gyear<=2011, robust nolog

Negative binomial regression                    Number of obs     =     52,578
                                                Wald chi2(38)     =   25324.86
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood = -33419.049               Pseudo R2         =     0.2958

------------------------------------------------------------------------------
             |               Robust
      ctwits |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      drelph |  -.4170196   .0261294   -15.96   0.000    -.4682323    -.365807
     drelnph |  -.0138591   .0182468    -0.76   0.448    -.0496222    .0219039
      dsecph |  -.0680933   .0217707    -3.13   0.002    -.1107631   -.0254236
  irqelect30 |   .0937473   .0477146     1.96   0.049     .0002284    .1872662
   uselect30 |   .1137526   .0425214     2.68   0.007     .0304121    .1970931
    oilprice |   .0035759   .0009203     3.89   0.000     .0017722    .0053796
  grainindex |  -.0020602   .0004642    -4.44   0.000    -.0029699   -.0011505
        temp |   .0034715   .0009736     3.57   0.000     .0015634    .0053796
        wesd |  -.0001484   .0068746    -0.02   0.983    -.0136225    .0133256
      precip |   -.001343   .0024805    -0.54   0.588    -.0062048    .0035187
     tcloudc |  -.0005613   .0004285    -1.31   0.190    -.0014011    .0002786
 ctcoinactlg |  -.0051389   .0022017    -2.33   0.020    -.0094541   -.0008237
    dprovid2 |  -.1419959     .04258    -3.33   0.001    -.2254512   -.0585406
    dprovid3 |   1.449829   .0375031    38.66   0.000     1.376325    1.523334
    dprovid4 |  -.8892711   .0511276   -17.39   0.000    -.9894793   -.7890629
    dprovid5 |  -4.871073   .3135179   -15.54   0.000    -5.485557   -4.256589
    dprovid6 |   .6409883    .037853    16.93   0.000     .5667977    .7151789
    dprovid7 |  -3.453111   .1440383   -23.97   0.000    -3.735421   -3.170801
    dprovid8 |  -2.098157   .0907537   -23.12   0.000    -2.276031   -1.920283
    dprovid9 |  -2.531829   .1065916   -23.75   0.000    -2.740745   -2.322914
   dprovid10 |  -3.421372   .1554015   -22.02   0.000    -3.725953    -3.11679
   dprovid11 |  -2.512438   .1006447   -24.96   0.000    -2.709698   -2.315178
   dprovid12 |    .868885   .0372411    23.33   0.000     .7958938    .9418762
   dprovid13 |  -2.326929   .0904759   -25.72   0.000    -2.504258   -2.149599
   dprovid14 |    .204136   .0403268     5.06   0.000     .1250968    .2831751
   dprovid15 |     -3.546   .1617384   -21.92   0.000    -3.863001   -3.228998
   dprovid16 |    .388574   .0379286    10.24   0.000     .3142352    .4629128
   dprovid17 |  -2.876924   .1195795   -24.06   0.000    -3.111295   -2.642552
   dprovid18 |  -1.484576   .0632404   -23.48   0.000    -1.608525   -1.360627
       d2005 |      1.058     .06409    16.51   0.000     .9323859    1.183614
       d2006 |   1.565092   .0866077    18.07   0.000     1.395345     1.73484
       d2007 |   1.602759   .1112729    14.40   0.000     1.384668     1.82085
       d2008 |   1.014627   .1416523     7.16   0.000     .7369933     1.29226
       d2009 |   .7297689    .171001     4.27   0.000     .3946131    1.064925
       d2010 |   .6513458   .2003485     3.25   0.001     .2586699    1.044022
       d2011 |   .4902506   .2341746     2.09   0.036     .0312768    .9492244
       dayid |    .000156   .0000882     1.77   0.077    -.0000168    .0003288
    ctwitslg |     .08107   .0038978    20.80   0.000     .0734304    .0887095
       _cons |  -2.646014   .3042813    -8.70   0.000    -3.242394   -2.049633
-------------+----------------------------------------------------------------
    /lnalpha |  -1.024089   .0404593                     -1.103388   -.9447904
-------------+----------------------------------------------------------------
       alpha |   .3591234   .0145299                      .3317452     .388761
------------------------------------------------------------------------------

Simulating main parameters.  Please wait....
% of simulations completed: 2% 5% 7% 10% 12% 15% 17% 20% 22% 25% 27% 30% 32% 35% 37% 40% 42% 45% 47% 50% 52% 5
> 5% 57% 60% 62% 65% 67% 70% 72% 75% 77% 80% 82% 85% 87% 90% 92% 95% 97% 100% 

Number of simulations  : 1000
Names of new variables : b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 b18 b19 b20 b21 b22 b23 b2
> 4 b25 b26 b27 b28 b29 b30 b31 b32 b33 b34 b35 b36 b37 b38 b39 b40

. quietly generate dropb=.

. order dropb

. setx mean

. setx drelph 0 drelnph 0 dsecph 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local hbase=r(mean)

. quietly drop expval

. setx drelph 1 drelnph 0 dsecph 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Both Religious Day and Public Holiday"
. display (r(mean)-`hbase')/`hbase'
-.34094916

. *
. quietly drop expval

. setx drelph 0 drelnph 0 dsecph 1

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Secular Public Holiday"
. display (r(mean)-`hbase')/`hbase'
-.06513397

. *
. quietly drop expval

. setx mean

. setx irqelect30 0 uselect30 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local pbase=r(mean)

. quietly drop expval

. setx irqelect30 1 uselect30 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Iraqi Election within 30 Days"
. display (r(mean)-`pbase')/`pbase'
.09909335

. *
. quietly drop expval

. setx irqelect30 0 uselect30 1

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "US Election within 30 Days"
. display (r(mean)-`pbase')/`pbase'
.12277085

. *
. quietly drop expval

. setx mean

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local cbase=r(mean)

. quietly drop expval

. quietly summarize oilprice if gyear>=2004 & gyear<=2011, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx oilprice `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Oil Price +1 SD"
. display (r(mean)-`cbase')/`cbase'
.09448488

. *
. quietly drop expval

. setx mean

. quietly summarize grainindex if gyear>=2004 & gyear<=2011, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx grainindex `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Daily Grain Price Index +1 SD"
. display (r(mean)-`cbase')/`cbase'
-.11772549

. *
. quietly drop expval

. setx mean

. quietly summarize temp if gyear>=2004 & gyear<=2011, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx temp `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Mean Temp +1 SD"
. display (r(mean)-`cbase')/`cbase'
.03991065

. *
. quietly drop expval

. setx mean

. quietly summarize ctcoinactlg if gyear>=2004 & gyear<=2011, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx ctcoinactlg `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "COIN Activity +1 SD"
. display (r(mean)-`cbase')/`cbase'
-.02407802

. *
. quietly drop expval

. quietly drop dropb-drope

. 
. **Model 5
. clear matrix

. set seed 323

. quietly generate drope=.

. order drope

. estsimp nbreg ctgtd drelph drelnph dsecph irqelect30 uselect30 oilprice grainindex temp wesd precip tcloudc 
> ctcoinactlg dprovid2-dprovid18 d2005-d2014 dayid ctgtdlg if gyear>=2004 & gyear<=2014, robust nolog

Negative binomial regression                    Number of obs     =     72,306
                                                Wald chi2(41)     =    9911.39
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood = -26993.354               Pseudo R2         =     0.2604

------------------------------------------------------------------------------
             |               Robust
       ctgtd |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      drelph |  -.3729555    .038545    -9.68   0.000    -.4485024   -.2974086
     drelnph |   .0578427   .0278056     2.08   0.038     .0033447    .1123408
      dsecph |   .0129137   .0337237     0.38   0.702    -.0531835    .0790109
  irqelect30 |   .0317856   .0531255     0.60   0.550    -.0723386    .1359097
   uselect30 |  -.0876049   .0653358    -1.34   0.180    -.2156607    .0404509
    oilprice |   .0101898   .0012945     7.87   0.000     .0076527    .0127269
  grainindex |  -.0020794   .0006718    -3.10   0.002     -.003396   -.0007627
        temp |  -.0034836   .0013248    -2.63   0.009    -.0060802    -.000887
        wesd |   .0012462   .0127958     0.10   0.922    -.0238332    .0263256
      precip |  -.0041119   .0039582    -1.04   0.299    -.0118697     .003646
     tcloudc |   .0003835   .0006152     0.62   0.533    -.0008224    .0015893
 ctcoinactlg |   -.003414   .0019879    -1.72   0.086    -.0073103    .0004823
    dprovid2 |  -.6399369   .0594654   -10.76   0.000    -.7564869   -.5233869
    dprovid3 |   1.253183   .0421951    29.70   0.000     1.170482    1.335884
    dprovid4 |  -1.781585     .09209   -19.35   0.000    -1.962078   -1.601091
    dprovid5 |  -7.243381   1.001646    -7.23   0.000     -9.20657   -5.280191
    dprovid6 |   .2492912   .0469134     5.31   0.000     .1573427    .3412398
    dprovid7 |  -3.683691   .2594978   -14.20   0.000    -4.192298   -3.175085
    dprovid8 |  -2.406094   .1177517   -20.43   0.000    -2.636883   -2.175305
    dprovid9 |  -3.913319   .2093835   -18.69   0.000    -4.323704   -3.502935
   dprovid10 |  -4.712475   .3141999   -15.00   0.000    -5.328295   -4.096654
   dprovid11 |  -3.347162    .165258   -20.25   0.000    -3.671061   -3.023262
   dprovid12 |      .2445   .0455531     5.37   0.000     .1552175    .3337825
   dprovid13 |  -3.951541    .236742   -16.69   0.000    -4.415547   -3.487535
   dprovid14 |   .2206749   .0474459     4.65   0.000     .1276827    .3136671
   dprovid15 |  -4.092554   .2189073   -18.70   0.000    -4.521604   -3.663503
   dprovid16 |  -.1216429    .052771    -2.31   0.021     -.225072   -.0182137
   dprovid17 |  -3.326466   .1673528   -19.88   0.000    -3.654472   -2.998461
   dprovid18 |  -2.484573    .124187   -20.01   0.000    -2.727975   -2.241171
       d2005 |   .3479101   .0994469     3.50   0.000     .1529979    .5428224
       d2006 |   .3731971   .1291411     2.89   0.004     .1200853     .626309
       d2007 |   .5636757   .1665483     3.38   0.001     .2372469    .8901044
       d2008 |   .4048656   .2182475     1.86   0.064    -.0228916    .8326228
       d2009 |   .5552498   .2531598     2.19   0.028     .0590657    1.051434
       d2010 |   .2658441   .2964639     0.90   0.370    -.3152146    .8469027
       d2011 |   .0786968   .3510554     0.22   0.823    -.6093591    .7667527
       d2012 |   .1711554   .3979092     0.43   0.667    -.6087324    .9510432
       d2013 |   .6226468    .441049     1.41   0.158    -.2417934    1.487087
       d2014 |   .8316014   .4833283     1.72   0.085    -.1157046    1.778907
       dayid |   .0003402   .0001289     2.64   0.008     .0000875    .0005929
     ctgtdlg |   .1368537   .0097747    14.00   0.000     .1176957    .1560117
       _cons |  -1.696567   .3991693    -4.25   0.000    -2.478925   -.9142099
-------------+----------------------------------------------------------------
    /lnalpha |   .2478586   .0328799                      .1834152     .312302
-------------+----------------------------------------------------------------
       alpha |   1.281279   .0421283                      1.201313    1.366567
------------------------------------------------------------------------------

Simulating main parameters.  Please wait....
% of simulations completed: 2% 4% 6% 9% 11% 13% 16% 18% 20% 23% 25% 27% 30% 32% 34% 37% 39% 41% 44% 46% 48% 51
> % 53% 55% 58% 60% 62% 65% 67% 69% 72% 74% 76% 79% 81% 83% 86% 88% 90% 93% 95% 97% 100% 

Number of simulations  : 1000
Names of new variables : b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 b18 b19 b20 b21 b22 b23 b2
> 4 b25 b26 b27 b28 b29 b30 b31 b32 b33 b34 b35 b36 b37 b38 b39 b40 b41 b42 b43

. quietly generate dropb=.

. order dropb

. setx mean

. setx drelph 0 drelnph 0 dsecph 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local hbase=r(mean)

. quietly drop expval

. setx drelph 1 drelnph 0 dsecph 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Both Religious Day and Public Holiday"
. display (r(mean)-`hbase')/`hbase'
-.31117723

. *
. quietly drop expval

. setx drelph 0 drelnph 1 dsecph 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Both Religious Day and Not Public Holiday"
. display (r(mean)-`hbase')/`hbase'
.05994843

. *
. quietly drop expval

. setx mean

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local cbase=r(mean)

. quietly drop expval

. quietly summarize oilprice if gyear>=2004 & gyear<=2014, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx oilprice `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Oil Price +1 SD"
. display (r(mean)-`cbase')/`cbase'
.31716904

. *
. quietly drop expval

. setx mean

. quietly summarize grainindex if gyear>=2004 & gyear<=2014, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx grainindex `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Daily Grain Price Index +1 SD"
. display (r(mean)-`cbase')/`cbase'
-.12242603

. *
. quietly drop expval

. setx mean

. quietly summarize temp if gyear>=2004 & gyear<=2014, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx temp `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Mean Temp +1 SD"
. display (r(mean)-`cbase')/`cbase'
-.038284

. *
. quietly drop expval

. quietly drop dropb-drope

. 
. **Model 6
. clear matrix

. set seed 323

. quietly generate drope=.

. order drope

. estsimp nbreg ctibc drelph drelnph dsecph irqelect30 uselect30 oilprice grainindex temp wesd precip tcloudc 
> ctcoinactlg dprovid2-dprovid18 d2005-d2009 dayid ctibclg if (gyear>=2004 & gyear<=2008) | (gyear==2009 & gnu
> mmnth<=6), robust nolog

Negative binomial regression                    Number of obs     =     36,126
                                                Wald chi2(36)     =   20390.34
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood = -22282.872               Pseudo R2         =     0.3069

------------------------------------------------------------------------------
             |               Robust
       ctibc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      drelph |  -.3514358   .0297804   -11.80   0.000    -.4098042   -.2930674
     drelnph |   .0102637   .0217236     0.47   0.637    -.0323137    .0528411
      dsecph |  -.0515002   .0257092    -2.00   0.045    -.1018892   -.0011111
  irqelect30 |   .0188486   .0639512     0.29   0.768    -.1064935    .1441908
   uselect30 |   .2127272   .0497043     4.28   0.000     .1153086    .3101458
    oilprice |   .0008773   .0012282     0.71   0.475      -.00153    .0032846
  grainindex |   .0005891   .0006363     0.93   0.355     -.000658    .0018362
        temp |   .0023922   .0012598     1.90   0.058     -.000077    .0048614
        wesd |   .0057225   .0091922     0.62   0.534    -.0122938    .0237388
      precip |  -.0059526   .0028069    -2.12   0.034     -.011454   -.0004512
     tcloudc |  -.0016276   .0005316    -3.06   0.002    -.0026695   -.0005856
 ctcoinactlg |   .0001499   .0013959     0.11   0.914    -.0025859    .0028858
    dprovid2 |   .2166788   .0476054     4.55   0.000     .1233739    .3099838
    dprovid3 |   1.734173   .0436736    39.71   0.000     1.648575    1.819772
    dprovid4 |  -.6906792   .0616114   -11.21   0.000    -.8114353   -.5699231
    dprovid5 |  -5.137639   .5332722    -9.63   0.000    -6.182833   -4.092444
    dprovid6 |   .9229883   .0417432    22.11   0.000     .8411732    1.004803
    dprovid7 |  -3.113709   .1655187   -18.81   0.000     -3.43812   -2.789298
    dprovid8 |  -1.901688   .0975283   -19.50   0.000     -2.09284   -1.710536
    dprovid9 |   -2.03241   .1042237   -19.50   0.000    -2.236685   -1.828136
   dprovid10 |  -3.173028   .1898239   -16.72   0.000    -3.545076    -2.80098
   dprovid11 |  -1.993824   .1067235   -18.68   0.000    -2.202999    -1.78465
   dprovid12 |   .9321144   .0436289    21.36   0.000     .8466034    1.017625
   dprovid13 |  -1.592113   .0865074   -18.40   0.000    -1.761664   -1.422562
   dprovid14 |   .3362774    .047815     7.03   0.000     .2425617     .429993
   dprovid15 |  -3.285927   .1785803   -18.40   0.000    -3.635938   -2.935916
   dprovid16 |   .1600478    .047511     3.37   0.001      .066928    .2531676
   dprovid17 |  -2.869845   .1514405   -18.95   0.000    -3.166663   -2.573028
   dprovid18 |  -.5492819   .0596392    -9.21   0.000    -.6661726   -.4323912
       d2005 |   .8443734   .0769653    10.97   0.000     .6935241    .9952226
       d2006 |   1.688278   .1097577    15.38   0.000     1.473157    1.903399
       d2007 |   1.839986   .1404616    13.10   0.000     1.564686    2.115285
       d2008 |   1.180301   .1735232     6.80   0.000     .8402018      1.5204
       d2009 |    .786609   .2055268     3.83   0.000     .3837838    1.189434
       dayid |  -.0001199   .0001142    -1.05   0.294    -.0003437    .0001039
     ctibclg |   .0754847   .0038968    19.37   0.000     .0678471    .0831223
       _cons |  -2.756071   .3945969    -6.98   0.000    -3.529467   -1.982676
-------------+----------------------------------------------------------------
    /lnalpha |  -1.334537    .060372                     -1.452864    -1.21621
-------------+----------------------------------------------------------------
       alpha |   .2632801   .0158947                      .2338995    .2963513
------------------------------------------------------------------------------

Simulating main parameters.  Please wait....
% of simulations completed: 2% 5% 7% 10% 13% 15% 18% 21% 23% 26% 28% 31% 34% 36% 39% 42% 44% 47% 50% 52% 55% 5
> 7% 60% 63% 65% 68% 71% 73% 76% 78% 81% 84% 86% 89% 92% 94% 97% 100% 

Number of simulations  : 1000
Names of new variables : b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 b18 b19 b20 b21 b22 b23 b2
> 4 b25 b26 b27 b28 b29 b30 b31 b32 b33 b34 b35 b36 b37 b38

. quietly generate dropb=.

. order dropb

. setx mean

. setx drelph 0 drelnph 0 dsecph 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local hbase=r(mean)

. quietly drop expval

. setx drelph 1 drelnph 0 dsecph 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Both Religious Day and Public Holiday"
. display (r(mean)-`hbase')/`hbase'
-.29625928

. *
. quietly drop expval

. setx drelph 0 drelnph 0 dsecph 1

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Secular Public Holiday"
. display (r(mean)-`hbase')/`hbase'
-.04934188

. *
. quietly drop expval

. setx mean

. setx irqelect30 0 uselect30 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local pbase=r(mean)

. quietly drop expval

. setx irqelect30 0 uselect30 1

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "US Election within 30 Days"
. display (r(mean)-`pbase')/`pbase'
.24017546

. *
. quietly drop expval

. setx mean

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local cbase=r(mean)

. quietly drop expval

. quietly summarize precip if (gyear>=2004 & gyear<=2008) | (gyear==2009 & gnummnth<=6), detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx precip `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Mean Precipitation +1 SD"
. display (r(mean)-`cbase')/`cbase'
-.02041245

. *
. quietly drop expval

. setx mean

. quietly summarize tcloudc if (gyear>=2004 & gyear<=2008) | (gyear==2009 & gnummnth<=6), detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx tcloudc `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Mean Cloud Cover +1 SD"
. display (r(mean)-`cbase')/`cbase'
-.03441966

. *
. quietly drop expval

. 
. quietly drop dropb-drope

. 
. 
. ***Pakistan Models
. 
. use RRP-APSR-RepData-2017-04-04-PAK.dta, clear

. 
. **Model 7
. clear matrix

. set seed 323

. quietly generate drope=.

. order drope

. estsimp nbreg ctwits drelph drelnph dsecph pakelect30 uselect30 oilprice grainindex temp wesd precip tcloudc
>  ctcoinactlg dproid2-dproid8 d2005-d2011 dayid ctwitslg if gyear>=2004 & gyear<=2011, robust nolog

Negative binomial regression                    Number of obs     =     23,368
                                                Wald chi2(28)     =    5179.73
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood = -12668.728               Pseudo R2         =     0.2698

------------------------------------------------------------------------------
             |               Robust
      ctwits |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      drelph |    -.33733   .1085874    -3.11   0.002    -.5501574   -.1245026
     drelnph |   .0019445   .0303159     0.06   0.949    -.0574737    .0613626
      dsecph |  -.0160498    .037866    -0.42   0.672    -.0902658    .0581662
  pakelect30 |   .0062098   .0910346     0.07   0.946    -.1722148    .1846344
   uselect30 |  -.1818779   .0813116    -2.24   0.025    -.3412457   -.0225101
    oilprice |  -.0057818    .001481    -3.90   0.000    -.0086845   -.0028792
  grainindex |   .0026666   .0007413     3.60   0.000     .0012137    .0041195
        temp |   .0044373   .0025824     1.72   0.086     -.000624    .0094987
        wesd |  -.0053948   .0042485    -1.27   0.204    -.0137216    .0029321
      precip |  -.0054437   .0034826    -1.56   0.118    -.0122695    .0013822
     tcloudc |   .0010598   .0007657     1.38   0.166     -.000441    .0025606
 ctcoinactlg |   .0076493   .0017834     4.29   0.000     .0041539    .0111447
     dproid2 |   5.985957   .5286317    11.32   0.000     4.949857    7.022056
     dproid3 |   .1045269   .6673974     0.16   0.876    -1.203548    1.412602
     dproid4 |   5.535375   .5289792    10.46   0.000     4.498595    6.572155
     dproid5 |   2.406359   .5448965     4.42   0.000     1.338381    3.474337
     dproid6 |   3.980698   .5321842     7.48   0.000     2.937636     5.02376
     dproid7 |   5.972445   .5295247    11.28   0.000     4.934596    7.010294
     dproid8 |    4.34022   .5317614     8.16   0.000     3.297987    5.382454
       d2005 |   1.315392   .1403371     9.37   0.000     1.040336    1.590447
       d2006 |   1.271455   .1739021     7.31   0.000     .9306132    1.612297
       d2007 |   2.112496   .2075928    10.18   0.000     1.705621     2.51937
       d2008 |   2.750299   .2643687    10.40   0.000     2.232146    3.268452
       d2009 |   2.807361    .313524     8.95   0.000     2.192865    3.421857
       d2010 |   2.769861   .3643317     7.60   0.000     2.055784    3.483938
       d2011 |   2.969275   .4238181     7.01   0.000     2.138607    3.799943
       dayid |  -.0003319   .0001566    -2.12   0.034    -.0006389   -.0000249
    ctwitslg |   .1509642   .0093278    16.18   0.000      .132682    .1692464
       _cons |  -8.134029   .5452785   -14.92   0.000    -9.202755   -7.065303
-------------+----------------------------------------------------------------
    /lnalpha |  -.7053084   .0632717                     -.8293187   -.5812981
-------------+----------------------------------------------------------------
       alpha |   .4939562   .0312535                      .4363465     .559172
------------------------------------------------------------------------------

Simulating main parameters.  Please wait....
% of simulations completed: 3% 6% 10% 13% 16% 20% 23% 26% 30% 33% 36% 40% 43% 46% 50% 53% 56% 60% 63% 66% 70% 
> 73% 76% 80% 83% 86% 90% 93% 96% 100% 

Number of simulations  : 1000
Names of new variables : b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 b18 b19 b20 b21 b22 b23 b2
> 4 b25 b26 b27 b28 b29 b30

. quietly generate dropb=.

. order dropb

. setx mean

. setx drelph 0 drelnph 0 dsecph 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local hbase=r(mean)

. quietly drop expval

. setx drelph 1 drelnph 0 dsecph 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Both Religious Day and Public Holiday"
. display (r(mean)-`hbase')/`hbase'
-.2824601

. *
. quietly drop expval

. setx mean

. setx pakelect30 0 uselect30 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local pbase=r(mean)

. quietly drop expval

. setx pakelect30 0 uselect30 1

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "US Election within 30 Days"
. display (r(mean)-`pbase')/`pbase'
-.16155956

. *
. quietly drop expval

. setx mean

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local cbase=r(mean)

. quietly drop expval

. quietly summarize oilprice if gyear>=2004 & gyear<=2011, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx oilprice `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Oil Price +1 SD"
. display (r(mean)-`cbase')/`cbase'
-.13682925

. *
. quietly drop expval

. setx mean

. quietly summarize grainindex if gyear>=2004 & gyear<=2011, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx grainindex `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Daily Grain Price Index +1 SD"
. display (r(mean)-`cbase')/`cbase'
.18007573

. *
. quietly drop expval

. setx mean

. quietly summarize ctcoinactlg if gyear>=2004 & gyear<=2011, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx ctcoinactlg `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "COIN Activity +1 SD"
. display (r(mean)-`cbase')/`cbase'
.03303277

. *
. quietly drop expval

. quietly drop dropb-drope

. 
. **Model 8
. clear matrix

. set seed 323

. quietly generate drope=.

. order drope

. estsimp nbreg ctgtd drelph drelnph dsecph pakelect30 uselect30 oilprice grainindex temp wesd precip tcloudc 
> ctcoinactlg dproid2-dproid8 d2005-d2014 dayid ctgtdlg if gyear>=2004 & gyear<=2014, robust nolog

Negative binomial regression                    Number of obs     =     32,136
                                                Wald chi2(31)     =    6069.35
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood = -15345.781               Pseudo R2         =     0.2675

------------------------------------------------------------------------------
             |               Robust
       ctgtd |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      drelph |  -.3611314   .1129717    -3.20   0.001    -.5825518    -.139711
     drelnph |   .0006902   .0293704     0.02   0.981    -.0568748    .0582552
      dsecph |  -.0498758   .0374321    -1.33   0.183    -.1232414    .0234898
  pakelect30 |    .359967   .0728245     4.94   0.000     .2172336    .5027003
   uselect30 |  -.0461764   .0709188    -0.65   0.515    -.1851747     .092822
    oilprice |  -.0030114   .0013954    -2.16   0.031    -.0057463   -.0002765
  grainindex |     .00047   .0007314     0.64   0.520    -.0009634    .0019035
        temp |  -.0009822   .0021398    -0.46   0.646    -.0051761    .0032117
        wesd |   .0019357   .0042044     0.46   0.645    -.0063046    .0101761
      precip |  -.0139337   .0042661    -3.27   0.001    -.0222951   -.0055724
     tcloudc |   .0007666   .0007434     1.03   0.302    -.0006905    .0022237
 ctcoinactlg |   .0047021   .0022569     2.08   0.037     .0002787    .0091255
     dproid2 |   4.414105    .205911    21.44   0.000     4.010527    4.817683
     dproid3 |  -1.872088   .4921142    -3.80   0.000    -2.836614   -.9075623
     dproid4 |   3.962185   .2096405    18.90   0.000     3.551297    4.373073
     dproid5 |   .8578626   .2410143     3.56   0.000     .3854833    1.330242
     dproid6 |   2.367071   .2190718    10.80   0.000     1.937698    2.796443
     dproid7 |   4.218265   .2117993    19.92   0.000     3.803146    4.633384
     dproid8 |   3.747352   .2155628    17.38   0.000     3.324857    4.169848
       d2005 |   .2271491   .2059322     1.10   0.270    -.1764706    .6307687
       d2006 |   1.025744   .2125143     4.83   0.000      .609224    1.442265
       d2007 |   1.471009     .23062     6.38   0.000     1.019002    1.923015
       d2008 |   2.245491   .2883276     7.79   0.000      1.68038    2.810603
       d2009 |   2.397879   .3181354     7.54   0.000     1.774345    3.021413
       d2010 |   2.561446    .371452     6.90   0.000     1.833413    3.289478
       d2011 |   2.986246   .4362569     6.85   0.000     2.131198    3.841294
       d2012 |   3.449092   .4879447     7.07   0.000     2.492738    4.405446
       d2013 |   3.667856    .531153     6.91   0.000     2.626815    4.708897
       d2014 |   3.732032   .5806213     6.43   0.000     2.594035    4.870029
       dayid |  -.0000747   .0001481    -0.50   0.614    -.0003649    .0002155
     ctgtdlg |   .1013798   .0113778     8.91   0.000     .0790797    .1236799
       _cons |   -7.17364   .2748493   -26.10   0.000    -7.712335   -6.634945
-------------+----------------------------------------------------------------
    /lnalpha |  -.4690815   .0721261                     -.6104462   -.3277169
-------------+----------------------------------------------------------------
       alpha |   .6255766   .0451204                      .5431085     .720567
------------------------------------------------------------------------------

Simulating main parameters.  Please wait....
% of simulations completed: 3% 6% 9% 12% 15% 18% 21% 24% 27% 30% 33% 36% 39% 42% 45% 48% 51% 54% 57% 60% 63% 6
> 6% 69% 72% 75% 78% 81% 84% 87% 90% 93% 96% 100% 

Number of simulations  : 1000
Names of new variables : b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 b18 b19 b20 b21 b22 b23 b2
> 4 b25 b26 b27 b28 b29 b30 b31 b32 b33

. quietly generate dropb=.

. order dropb

. setx mean

. setx drelph 0 drelnph 0 dsecph 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local hbase=r(mean)

. quietly drop expval

. setx drelph 1 drelnph 0 dsecph 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Both Religious Day and Public Holiday"
. display (r(mean)-`hbase')/`hbase'
-.29920711

. *
. quietly drop expval

. setx mean

. setx pakelect30 0 uselect30 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local pbase=r(mean)

. quietly drop expval

. setx pakelect30 1 uselect30 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Pakistani Election within 30 Days"
. display (r(mean)-`pbase')/`pbase'
.43603734

. *
. quietly drop expval

. setx mean

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local cbase=r(mean)

. quietly drop expval

. quietly summarize oilprice if gyear>=2004 & gyear<=2014, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx oilprice `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Oil Price +1 SD"
. display (r(mean)-`cbase')/`cbase'
-.07889277

. *
. quietly drop expval

. setx mean

. quietly summarize precip if gyear>=2004 & gyear<=2014, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx precip `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Mean Precipitation +1 SD"
. display (r(mean)-`cbase')/`cbase'
-.05775783

. *
. quietly drop expval

. setx mean

. quietly summarize ctcoinactlg if gyear>=2004 & gyear<=2014, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx ctcoinactlg `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "COIN Activity +1 SD"
. display (r(mean)-`cbase')/`cbase'
.02039205

. *
. quietly drop expval

. quietly drop dropb-drope

. 
. **Model 9
. clear matrix

. set seed 323

. quietly generate drope=.

. order drope

. estsimp nbreg ctpips drelph drelnph dsecph pakelect30 uselect30 oilprice grainindex temp wesd precip tcloudc
>  ctcoinactlg dproid2-dproid8 d2005-d2014 dayid ctpipslg if gyear>=2004 & gyear<=2014, robust nolog

Negative binomial regression                    Number of obs     =     32,136
                                                Wald chi2(31)     =    9803.86
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood =  -21824.22               Pseudo R2         =     0.3233

------------------------------------------------------------------------------
             |               Robust
      ctpips |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      drelph |  -.5290489   .0820687    -6.45   0.000    -.6899006   -.3681972
     drelnph |  -.0151747   .0190386    -0.80   0.425    -.0524897    .0221403
      dsecph |    .030826   .0227522     1.35   0.175    -.0137675    .0754195
  pakelect30 |   .1988985    .056711     3.51   0.000      .087747    .3100501
   uselect30 |  -.0734887   .0472603    -1.55   0.120    -.1661171    .0191398
    oilprice |  -.0011046   .0008248    -1.34   0.180    -.0027211     .000512
  grainindex |   .0003277   .0004264     0.77   0.442     -.000508    .0011634
        temp |   .0025964   .0014278     1.82   0.069    -.0002021    .0053948
        wesd |   .0001009   .0027923     0.04   0.971    -.0053718    .0055736
      precip |  -.0052853   .0027829    -1.90   0.058    -.0107396     .000169
     tcloudc |   .0012559   .0004876     2.58   0.010     .0003002    .0022117
 ctcoinactlg |    .007052   .0011601     6.08   0.000     .0047781    .0093258
     dproid2 |   3.805058   .1253108    30.36   0.000     3.559453    4.050662
     dproid3 |   .3163449   .1559577     2.03   0.043     .0106733    .6220164
     dproid4 |   3.673195   .1275963    28.79   0.000      3.42311    3.923279
     dproid5 |  -.3413542   .1776945    -1.92   0.055    -.6896291    .0069206
     dproid6 |     1.5255   .1377729    11.07   0.000      1.25547     1.79553
     dproid7 |   3.719908   .1294311    28.74   0.000     3.466228    3.973588
     dproid8 |   3.050808   .1307501    23.33   0.000     2.794543    3.307074
       d2005 |   .0152498    .434949     0.04   0.972    -.8372345    .8677341
       d2006 |   2.660181   .3189428     8.34   0.000     2.035064    3.285297
       d2007 |   4.448043   .3215254    13.83   0.000     3.817864    5.078221
       d2008 |   4.768261   .3377183    14.12   0.000     4.106345    5.430177
       d2009 |   4.847598    .352353    13.76   0.000     4.156999    5.538197
       d2010 |   4.718516   .3714496    12.70   0.000     3.990488    5.446544
       d2011 |   4.643182   .3965056    11.71   0.000     3.866045    5.420318
       d2012 |   4.354788   .4198983    10.37   0.000     3.531802    5.177773
       d2013 |   4.394019     .44473     9.88   0.000     3.522364    5.265674
       d2014 |   4.131816   .4708374     8.78   0.000     3.208992     5.05464
       dayid |   .0002486   .0000983     2.53   0.011     .0000559    .0004413
    ctpipslg |   .1220847   .0051881    23.53   0.000     .1119162    .1322532
       _cons |  -8.639341   .3335179   -25.90   0.000    -9.293024   -7.985658
-------------+----------------------------------------------------------------
    /lnalpha |  -1.418162   .0555828                     -1.527102   -1.309221
-------------+----------------------------------------------------------------
       alpha |   .2421588   .0134599                      .2171641    .2700303
------------------------------------------------------------------------------

Simulating main parameters.  Please wait....
% of simulations completed: 3% 6% 9% 12% 15% 18% 21% 24% 27% 30% 33% 36% 39% 42% 45% 48% 51% 54% 57% 60% 63% 6
> 6% 69% 72% 75% 78% 81% 84% 87% 90% 93% 96% 100% 

Number of simulations  : 1000
Names of new variables : b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 b18 b19 b20 b21 b22 b23 b2
> 4 b25 b26 b27 b28 b29 b30 b31 b32 b33

. quietly generate dropb=.

. order dropb

. setx mean

. setx drelph 0 drelnph 0 dsecph 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local hbase=r(mean)

. quietly drop expval

. setx drelph 1 drelnph 0 dsecph 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Both Religious Day and Public Holiday"
. display (r(mean)-`hbase')/`hbase'
-.40903541

. *
. quietly drop expval

. setx mean

. setx pakelect30 0 uselect30 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local pbase=r(mean)

. quietly drop expval

. setx pakelect30 1 uselect30 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Pakistani Election within 30 Days"
. display (r(mean)-`pbase')/`pbase'
.22145381

. *
. quietly drop expval

. setx mean

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local cbase=r(mean)

. quietly drop expval

. quietly summarize tcloudc if gyear>=2004 & gyear<=2014, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx tcloudc `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "Mean Cloud Cover +1 SD"
. display (r(mean)-`cbase')/`cbase'
.0248601

. *
. quietly drop expval

. setx mean

. quietly summarize ctcoinactlg if gyear>=2004 & gyear<=2014, detail

. local ivmean=r(mean)

. local ivstdev=r(sd)

. local mp1sd=`ivmean'+`ivstdev'

. setx ctcoinactlg `mp1sd'

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "Daily Mean" Baseline to "COIN Activity +1 SD"
. display (r(mean)-`cbase')/`cbase'
.03025862

. *
. quietly drop expval

. quietly drop dropb-drope

. 
. 
. ****************************************************************************************
. * Table 7
. ****************************************************************************************
. 
. 
. ***Afghanistan Models
. 
. use RRP-APSR-RepData-2017-04-04-AFG.dta, clear

. 
. **Model 1
. clear matrix

. set seed 323

. quietly generate drope=.

. order drope

. estsimp nbreg ctwits ddowk6 dhm01 dhm07 dhm09 dhm11 dhm12 dahny1 ddoas1 dmanu1 dmanh1 disam1 dlyab1 dfdor1 d
> laqh1 dlaqu1 deidf3 ddoar1 deida4 dlibd1 danyd1 dvicd1 dlabd1 dindd1 afgelect30 uselect30 oilprice graininde
> x temp wesd precip tcloudc ctcoinactlg drcid2-drcid5 d2005-d2011 dayid ctwitslg if gyear>=2004 & gyear<=2011
> , robust nolog

Negative binomial regression                    Number of obs     =     14,605
                                                Wald chi2(45)     =    4541.20
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood = -14763.505               Pseudo R2         =     0.1799

------------------------------------------------------------------------------
             |               Robust
      ctwits |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      ddowk6 |  -.1373754   .0465731    -2.95   0.003     -.228657   -.0460938
       dhm01 |  -.2347196   .0718508    -3.27   0.001    -.3755447   -.0938945
       dhm07 |   .0017315   .0484582     0.04   0.971    -.0932448    .0967078
       dhm09 |   .0208988    .055406     0.38   0.706    -.0876949    .1294925
       dhm11 |  -.0387193   .0758768    -0.51   0.610    -.1874352    .1099966
       dhm12 |  -.0731439   .0752974    -0.97   0.331     -.220724    .0744363
      dahny1 |   .6955299   .3776163     1.84   0.065    -.0445845    1.435644
      ddoas1 |  -.3200741   .2148145    -1.49   0.136    -.7411029    .1009547
      dmanu1 |   .0050673   .2297928     0.02   0.982    -.4453183    .4554529
      dmanh1 |  -.0565923   .2324538    -0.24   0.808    -.5121933    .3990087
      disam1 |   .0003229   .2239935     0.00   0.999    -.4386963    .4393421
      dlyab1 |    -.44957   .1909147    -2.35   0.019    -.8237559   -.0753842
      dfdor1 |  -.2477627   .2221561    -1.12   0.265    -.6831807    .1876553
      dlaqh1 |   -.185509   .1983245    -0.94   0.350    -.5742178    .2031998
      dlaqu1 |   -.560388   .2109056    -2.66   0.008    -.9737555   -.1470206
      deidf3 |  -1.376221   .1632344    -8.43   0.000    -1.696154   -1.056287
      ddoar1 |  -.5368171   .3305891    -1.62   0.104     -1.18476    .1111257
      deida4 |   -.149069   .1925247    -0.77   0.439    -.5264104    .2282725
      dlibd1 |  -.0323899   .2451482    -0.13   0.895    -.5128716    .4480919
      danyd1 |  -.2020086   .2513738    -0.80   0.422    -.6946923     .290675
      dvicd1 |  -.1829643   .2546746    -0.72   0.472    -.6821173    .3161888
      dlabd1 |   .2424364   .1625935     1.49   0.136     -.076241    .5611137
      dindd1 |   .1288859   .2071755     0.62   0.534    -.2771706    .5349425
  afgelect30 |   .2482905   .0776793     3.20   0.001      .096042    .4005391
   uselect30 |   .0210308   .0843718     0.25   0.803    -.1443348    .1863965
    oilprice |  -.0012469   .0016669    -0.75   0.454    -.0045139    .0020201
  grainindex |   .0007638   .0008237     0.93   0.354    -.0008507    .0023783
        temp |   .0131593   .0030796     4.27   0.000     .0071233    .0191953
        wesd |  -.0187508   .0039581    -4.74   0.000    -.0265086    -.010993
      precip |  -.0151695   .0069837    -2.17   0.030    -.0288572   -.0014818
     tcloudc |  -.0014451     .00083    -1.74   0.082    -.0030718    .0001817
 ctcoinactlg |   .0008189     .00153     0.54   0.592    -.0021798    .0038176
      drcid2 |   2.699388    .070369    38.36   0.000     2.561468    2.837309
      drcid3 |   1.560252   .0757859    20.59   0.000     1.411715     1.70879
      drcid4 |   2.276877   .0762348    29.87   0.000     2.127459    2.426294
      drcid5 |   1.198196   .0683046    17.54   0.000     1.064322    1.332071
       d2005 |   1.159521   .1307679     8.87   0.000     .9032204    1.415821
       d2006 |   1.773183   .1847385     9.60   0.000     1.411102    2.135263
       d2007 |   1.804615    .255025     7.08   0.000     1.304775    2.304455
       d2008 |   1.791356   .3367318     5.32   0.000     1.131374    2.451338
       d2009 |   2.340639   .4052395     5.78   0.000     1.546384    3.134894
       d2010 |   2.677757    .476053     5.62   0.000     1.744711    3.610804
       d2011 |   2.516478   .5679874     4.43   0.000     1.403243    3.629713
       dayid |   .0001691    .000215     0.79   0.432    -.0002522    .0005904
    ctwitslg |   .0098344   .0053362     1.84   0.065    -.0006244    .0202932
       _cons |  -4.505063   .1523074   -29.58   0.000     -4.80358   -4.206546
-------------+----------------------------------------------------------------
    /lnalpha |   -.437172   .0550813                     -.5451293   -.3292147
-------------+----------------------------------------------------------------
       alpha |   .6458603   .0355748                      .5797668    .7194885
------------------------------------------------------------------------------

Simulating main parameters.  Please wait....
% of simulations completed: 2% 4% 6% 8% 10% 12% 14% 17% 19% 21% 23% 25% 27% 29% 31% 34% 36% 38% 40% 42% 44% 46
> % 48% 51% 53% 55% 57% 59% 61% 63% 65% 68% 70% 72% 74% 76% 78% 80% 82% 85% 87% 89% 91% 93% 95% 97% 100% 

Number of simulations  : 1000
Names of new variables : b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 b18 b19 b20 b21 b22 b23 b2
> 4 b25 b26 b27 b28 b29 b30 b31 b32 b33 b34 b35 b36 b37 b38 b39 b40 b41 b42 b43 b44 b45 b46 b47

. quietly generate dropb=.

. order dropb

. setx mean

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 dlibd1 0 danyd1 0 dvicd1 0 dlabd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local hbase=r(mean)

. quietly drop expval

. setx ddowk6 1 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 dlibd1 0 danyd1 0 dvicd1 0 dlabd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Friday"
. display (r(mean)-`hbase')/`hbase'
-.12787406

. *
. quietly drop expval

. setx ddowk6 0 dhm01 1 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 dlibd1 0 danyd1 0 dvicd1 0 dlabd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Muharram"
. display (r(mean)-`hbase')/`hbase'
-.2065742

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 1 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 dlibd1 0 danyd1 0 dvicd1 0 dlabd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Laylat al-Bara'at"
. display (r(mean)-`hbase')/`hbase'
-.34465546

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 1 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 1 deidf3 0 ddoar1 0 deida4 0 dlibd1 0 danyd1 0 dvicd1 0 dlabd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Laylat al-Qadar (Sunni)"
. display (r(mean)-`hbase')/`hbase'
-.40498853

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 1 ddoar1 0 deida4 0 dlibd1 0 danyd1 0 dvicd1 0 dlabd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Eid al-Fitr (3 Day)"
. display (r(mean)-`hbase')/`hbase'
-.74476954

. *
. quietly drop expval

. quietly drop dropb-drope

. 
. 
. **Model 2
. clear matrix

. set seed 323

. quietly generate drope=.

. order drope

. estsimp nbreg ctgtd ddowk6 dhm01 dhm07 dhm09 dhm11 dhm12 dahny1 ddoas1 dmanu1 dmanh1 disam1 dlyab1 dfdor1 dl
> aqh1 dlaqu1 deidf3 ddoar1 deida4 dlibd1 danyd1 dvicd1 dlabd1 dindd1 afgelect30 uselect30 oilprice grainindex
>  temp wesd precip tcloudc ctcoinactlg drcid2-drcid5 d2005-d2014 dayid ctgtdlg if gyear>=2004 & gyear<=2014, 
> robust nolog

Negative binomial regression                    Number of obs     =     20,085
                                                Wald chi2(48)     =    5026.53
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood = -13050.994               Pseudo R2         =     0.1711

------------------------------------------------------------------------------
             |               Robust
       ctgtd |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      ddowk6 |  -.1939478   .0420682    -4.61   0.000    -.2763999   -.1114957
       dhm01 |   -.152779    .064585    -2.37   0.018    -.2793632   -.0261948
       dhm07 |   .0814717   .0470828     1.73   0.084    -.0108089    .1737523
       dhm09 |  -.1398336   .0546802    -2.56   0.011    -.2470047   -.0326625
       dhm11 |  -.1242863   .0576498    -2.16   0.031    -.2372779   -.0112947
       dhm12 |   .0397397   .0637028     0.62   0.533    -.0851156     .164595
      dahny1 |  -.1155316   .2848246    -0.41   0.685    -.6737776    .4427144
      ddoas1 |  -.3745702   .2596426    -1.44   0.149    -.8834604    .1343201
      dmanu1 |  -.1141873   .3090139    -0.37   0.712    -.7198434    .4914688
      dmanh1 |  -.4669971   .2801403    -1.67   0.096    -1.016062    .0820677
      disam1 |  -.2486997   .2565708    -0.97   0.332    -.7515693    .2541699
      dlyab1 |  -.9134533   .3109123    -2.94   0.003     -1.52283   -.3040764
      dfdor1 |  -.7537791   .3002506    -2.51   0.012    -1.342259   -.1652988
      dlaqh1 |   .0163659    .197857     0.08   0.934    -.3714267    .4041585
      dlaqu1 |  -.1210884   .2123166    -0.57   0.568    -.5372214    .2950445
      deidf3 |   -.923556   .2115141    -4.37   0.000    -1.338116    -.508996
      ddoar1 |  -.6644317   .2895914    -2.29   0.022     -1.23202    -.096843
      deida4 |  -.2901442   .1602299    -1.81   0.070    -.6041891    .0239007
      dlibd1 |  -.1572658   .3095507    -0.51   0.611    -.7639741    .4494425
      danyd1 |   .0271508   .2543624     0.11   0.915    -.4713903     .525692
      dvicd1 |   .0466683   .2263382     0.21   0.837    -.3969465    .4902831
      dlabd1 |  -.1664827   .2026133    -0.82   0.411    -.5635976    .2306321
      dindd1 |   -.331515   .2226834    -1.49   0.137    -.7679664    .1049364
  afgelect30 |    .568773   .1367144     4.16   0.000     .3008177    .8367283
   uselect30 |  -.1065356   .0693778    -1.54   0.125    -.2425136    .0294423
    oilprice |   .0024324   .0014552     1.67   0.095    -.0004196    .0052845
  grainindex |  -.0019886   .0008399    -2.37   0.018    -.0036348   -.0003424
        temp |   .0068031   .0025378     2.68   0.007      .001829    .0117772
        wesd |  -.0222572   .0040514    -5.49   0.000    -.0301978   -.0143166
      precip |  -.0160106   .0067139    -2.38   0.017    -.0291696   -.0028516
     tcloudc |  -.0006034    .000798    -0.76   0.450    -.0021674    .0009606
 ctcoinactlg |   .0036354   .0020048     1.81   0.070    -.0002938    .0075647
      drcid2 |   1.849277   .0712509    25.95   0.000     1.709627    1.988926
      drcid3 |   .8612834   .0774988    11.11   0.000     .7093886    1.013178
      drcid4 |   1.526883   .0722112    21.14   0.000     1.385352    1.668414
      drcid5 |   .6312283   .0751771     8.40   0.000     .4838838    .7785728
       d2005 |    .476504   .1563853     3.05   0.002     .1699944    .7830137
       d2006 |   1.077106   .1982838     5.43   0.000     .6884765    1.465735
       d2007 |   1.295341   .2562605     5.05   0.000     .7930802    1.797603
       d2008 |   1.545152   .3451184     4.48   0.000     .8687321    2.221571
       d2009 |   1.610105    .398235     4.04   0.000      .829579    2.390632
       d2010 |   1.552556   .4628832     3.35   0.001     .6453217     2.45979
       d2011 |   1.419887   .5523851     2.57   0.010     .3372318    2.502542
       d2012 |   2.626668   .6285871     4.18   0.000      1.39466    3.858676
       d2013 |   2.536681   .6946943     3.65   0.000     1.175105    3.898256
       d2014 |    2.73019   .7650474     3.57   0.000     1.230724    4.229655
       dayid |   .0001089   .0002036     0.53   0.593    -.0002902    .0005081
     ctgtdlg |   .0561617   .0143666     3.91   0.000     .0280037    .0843196
       _cons |  -4.050911   .1803332   -22.46   0.000    -4.404357   -3.697464
-------------+----------------------------------------------------------------
    /lnalpha |  -.7265877   .1021393                      -.926777   -.5263985
-------------+----------------------------------------------------------------
       alpha |   .4835562   .0493901                      .3958274    .5907287
------------------------------------------------------------------------------

Simulating main parameters.  Please wait....
% of simulations completed: 2% 4% 6% 8% 10% 12% 14% 16% 18% 20% 22% 24% 26% 28% 30% 32% 34% 36% 38% 40% 42% 44
> % 46% 48% 50% 52% 54% 56% 58% 60% 62% 64% 66% 68% 70% 72% 74% 76% 78% 80% 82% 84% 86% 88% 90% 92% 94% 96% 98
> % 100% 

Number of simulations  : 1000
Names of new variables : b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 b18 b19 b20 b21 b22 b23 b2
> 4 b25 b26 b27 b28 b29 b30 b31 b32 b33 b34 b35 b36 b37 b38 b39 b40 b41 b42 b43 b44 b45 b46 b47 b48 b49 b50

. quietly generate dropb=.

. order dropb

. setx mean

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 dlibd1 0 danyd1 0 dvicd1 0 dlabd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local hbase=r(mean)

. quietly drop expval

. setx ddowk6 1 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 dlibd1 0 danyd1 0 dvicd1 0 dlabd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Friday"
. display (r(mean)-`hbase')/`hbase'
-.17593569

. *
. quietly drop expval

. setx ddowk6 0 dhm01 1 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 dlibd1 0 danyd1 0 dvicd1 0 dlabd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Muharram"
. display (r(mean)-`hbase')/`hbase'
-.13922189

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 1 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 dlibd1 0 danyd1 0 dvicd1 0 dlabd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Ramadan"
. display (r(mean)-`hbase')/`hbase'
-.12938324

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 1 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 dlibd1 0 danyd1 0 dvicd1 0 dlabd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Dhu al-Qada"
. display (r(mean)-`hbase')/`hbase'
-.11399475

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 1 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 dlibd1 0 danyd1 0 dvicd1 0 dlabd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Laylat al-Bara'at"
. display (r(mean)-`hbase')/`hbase'
-.57234977

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 1 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 1 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 dlibd1 0 danyd1 0 dvicd1 0 dlabd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "First Day of Ramadan"
. display (r(mean)-`hbase')/`hbase'
-.57544819

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 1 ddoar1 0 deida4 0 dlibd1 0 danyd1 0 dvicd1 0 dlabd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Eid al-Fitr (3 Day)"
. display (r(mean)-`hbase')/`hbase'
-.59539939

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 1 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 1 deida4 0 dlibd1 0 danyd1 0 dvicd1 0 dlabd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Day of Arafah"
. display (r(mean)-`hbase')/`hbase'
-.43951318

. *
. quietly drop expval

. quietly drop dropb-drope

. 
. 
. **Model 3
. clear matrix

. set seed 323

. quietly generate drope=.

. order drope

. estsimp nbreg ctsigact ddowk6 dhm01 dhm07 dhm09 dhm11 dhm12 dahny1 ddoas1 dmanu1 dmanh1 disam1 dlyab1 dfdor1
>  dlaqh1 dlaqu1 deidf3 ddoar1 deida4 dlibd1 danyd1 dvicd1 dlabd1 dindd1 afgelect30 uselect30 oilprice grainin
> dex temp wesd precip tcloudc ctcoinactlg drcid2-drcid5 d2009-d2014 dayid ctsigactlg if gyear>=2008 & gyear<=
> 2014, robust nolog

Negative binomial regression                    Number of obs     =     12,780
                                                Wald chi2(44)     =   54260.70
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood = -31808.855               Pseudo R2         =     0.2740

------------------------------------------------------------------------------
             |               Robust
    ctsigact |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      ddowk6 |   -.059938   .0132263    -4.53   0.000    -.0858611   -.0340149
       dhm01 |  -.1780204   .0225261    -7.90   0.000    -.2221708     -.13387
       dhm07 |   .0952862   .0188388     5.06   0.000     .0583627    .1322096
       dhm09 |   .0299815   .0190245     1.58   0.115    -.0073059    .0672688
       dhm11 |  -.0255108   .0182366    -1.40   0.162    -.0612539    .0102324
       dhm12 |  -.0700255   .0225962    -3.10   0.002    -.1143132   -.0257378
      dahny1 |  -.0761628   .0882628    -0.86   0.388    -.2491547    .0968291
      ddoas1 |   .0117004   .0786666     0.15   0.882    -.1424833    .1658841
      dmanu1 |   .0160354   .0643332     0.25   0.803    -.1100554    .1421262
      dmanh1 |   .0638851   .0878941     0.73   0.467    -.1083841    .2361543
      disam1 |  -.0460652   .0847756    -0.54   0.587    -.2122223    .1200918
      dlyab1 |   .1883788   .1107624     1.70   0.089    -.0287115    .4054691
      dfdor1 |  -.3806831   .0918017    -4.15   0.000    -.5606112    -.200755
      dlaqh1 |    .024734   .0913384     0.27   0.787     -.154286     .203754
      dlaqu1 |   -.075035   .0880189    -0.85   0.394    -.2475489    .0974789
      deidf3 |   -.409662   .0496423    -8.25   0.000    -.5069591   -.3123648
      ddoar1 |  -.0558193   .0875925    -0.64   0.524    -.2274975    .1158588
      deida4 |  -.2548292   .0534359    -4.77   0.000    -.3595617   -.1500967
      dlibd1 |    .076442   .1015907     0.75   0.452    -.1226721     .275556
      danyd1 |   .0917916   .0980279     0.94   0.349    -.1003395    .2839227
      dvicd1 |   .0549136   .1003046     0.55   0.584    -.1416798     .251507
      dlabd1 |  -.0410311   .1115541    -0.37   0.713    -.2596732     .177611
      dindd1 |    .115511    .082467     1.40   0.161    -.0461214    .2771434
  afgelect30 |   .1935053   .0390378     4.96   0.000     .1169927     .270018
   uselect30 |  -.0274164   .0229438    -1.19   0.232    -.0723854    .0175526
    oilprice |   .0020248     .00048     4.22   0.000      .001084    .0029657
  grainindex |  -.0004747   .0002366    -2.01   0.045    -.0009384    -.000011
        temp |  -.0016058   .0008661    -1.85   0.064    -.0033034    .0000918
        wesd |  -.0229463    .001226   -18.72   0.000    -.0253492   -.0205434
      precip |  -.0120576   .0022666    -5.32   0.000    -.0165001   -.0076151
     tcloudc |  -.0007772   .0002884    -2.69   0.007    -.0013424   -.0002119
 ctcoinactlg |   .0011233   .0010705     1.05   0.294    -.0009749    .0032216
      drcid2 |   3.160246   .0380878    82.97   0.000     3.085595    3.234897
      drcid3 |   1.483898   .0357227    41.54   0.000     1.413883    1.553913
      drcid4 |   3.180493   .0443773    71.67   0.000     3.093515    3.267471
      drcid5 |   1.605794     .03371    47.64   0.000     1.539724    1.671865
       d2009 |   .2039651   .0356849     5.72   0.000     .1340239    .2739063
       d2010 |   .1963092   .0539118     3.64   0.000      .090644    .3019744
       d2011 |  -.0665427   .0792414    -0.84   0.401     -.221853    .0887677
       d2012 |  -.2621202   .1043656    -2.51   0.012     -.466673   -.0575673
       d2013 |  -.4024517   .1293428    -3.11   0.002    -.6559589   -.1489444
       d2014 |  -.7127654   .1564384    -4.56   0.000    -1.019379   -.4061518
       dayid |   .0007146   .0000725     9.85   0.000     .0005724    .0008567
  ctsigactlg |   .0177274   .0008606    20.60   0.000     .0160407    .0194142
       _cons |  -2.219579   .1420473   -15.63   0.000    -2.497987   -1.941172
-------------+----------------------------------------------------------------
    /lnalpha |  -2.181297   .0557283                     -2.290523   -2.072072
-------------+----------------------------------------------------------------
       alpha |    .112895   .0062914                      .1012135    .1259246
------------------------------------------------------------------------------

Simulating main parameters.  Please wait....
% of simulations completed: 2% 4% 6% 8% 10% 13% 15% 17% 19% 21% 23% 26% 28% 30% 32% 34% 36% 39% 41% 43% 45% 47
> % 50% 52% 54% 56% 58% 60% 63% 65% 67% 69% 71% 73% 76% 78% 80% 82% 84% 86% 89% 91% 93% 95% 97% 100% 

Number of simulations  : 1000
Names of new variables : b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 b18 b19 b20 b21 b22 b23 b2
> 4 b25 b26 b27 b28 b29 b30 b31 b32 b33 b34 b35 b36 b37 b38 b39 b40 b41 b42 b43 b44 b45 b46

. quietly generate dropb=.

. order dropb

. setx mean

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 dlibd1 0 danyd1 0 dvicd1 0 dlabd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local hbase=r(mean)

. quietly drop expval

. setx ddowk6 1 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 dlibd1 0 danyd1 0 dvicd1 0 dlabd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Friday"
. display (r(mean)-`hbase')/`hbase'
-.05817648

. *
. quietly drop expval

. setx ddowk6 0 dhm01 1 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 dlibd1 0 danyd1 0 dvicd1 0 dlabd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Muharram"
. display (r(mean)-`hbase')/`hbase'
-.16256801

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 1 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 dlibd1 0 danyd1 0 dvicd1 0 dlabd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Rajab"
. display (r(mean)-`hbase')/`hbase'
.10072395

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 1 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 dlibd1 0 danyd1 0 dvicd1 0 dlabd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Dhu al-Hijja"
. display (r(mean)-`hbase')/`hbase'
-.06786274

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 1 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 1 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 dlibd1 0 danyd1 0 dvicd1 0 dlabd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "First Day of Ramadan"
. display (r(mean)-`hbase')/`hbase'
-.29480265

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 1 ddoar1 0 deida4 0 dlibd1 0 danyd1 0 dvicd1 0 dlabd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Eid al-Fitr (3 Day)"
. display (r(mean)-`hbase')/`hbase'
-.33569117

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 1 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 1 dlibd1 0 danyd1 0 dvicd1 0 dlabd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Eid al-Ahda (4 Day)"
. display (r(mean)-`hbase')/`hbase'
-.27574398

. *
. quietly drop expval

. quietly drop dropb-drope

. 
. 
. ***Iraq Models
. 
. use RRP-APSR-RepData-2017-04-04-IRQ.dta, clear

. 
. **Model 4
. clear matrix

. set seed 323

. quietly generate drope=.

. order drope

. estsimp nbreg ctwits ddowk6 dhm01 dhm07 dhm09 dhm11 dhm12 dahny1 ddoas1 dmanu1 dmanh1 disam1 dlyab1 dfdor1 d
> laqh1 dlaqu1 deidf3 ddoar1 deida4 ddowk5 dnyrd1 darmd1 dlabd1 drepd1 dindd1 irqelect30 uselect30 oilprice gr
> ainindex temp wesd precip tcloudc ctcoinactlg dprovid2-dprovid18 d2005-d2011 dayid ctwitslg if gyear>=2004 &
>  gyear<=2011, robust nolog

Negative binomial regression                    Number of obs     =     52,578
                                                Wald chi2(59)     =   25539.17
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood = -33365.721               Pseudo R2         =     0.2969

------------------------------------------------------------------------------
             |               Robust
      ctwits |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      ddowk6 |  -.4010928   .0261427   -15.34   0.000    -.4523315   -.3498542
       dhm01 |   -.091226   .0344999    -2.64   0.008    -.1588446   -.0236073
       dhm07 |   .0105771   .0315227     0.34   0.737    -.0512061    .0723604
       dhm09 |   .0456054   .0311751     1.46   0.144    -.0154968    .1067075
       dhm11 |  -.1086832    .036289    -2.99   0.003    -.1798083    -.037558
       dhm12 |  -.1405537   .0373915    -3.76   0.000    -.2138397   -.0672677
      dahny1 |  -.0653666   .1489498    -0.44   0.661    -.3573028    .2265696
      ddoas1 |   .2236749   .1577099     1.42   0.156    -.0854308    .5327807
      dmanu1 |   .0471664   .1358848     0.35   0.729    -.2191628    .3134956
      dmanh1 |   .0004156   .1359046     0.00   0.998    -.2659525    .2667836
      disam1 |  -.0835632     .17811    -0.47   0.639    -.4326523    .2655259
      dlyab1 |   .0019708   .1758972     0.01   0.991    -.3427815     .346723
      dfdor1 |  -.4379281   .1513136    -2.89   0.004    -.7344973   -.1413588
      dlaqh1 |   .2480935   .1728758     1.44   0.151    -.0907367    .5869238
      dlaqu1 |   .2249314   .1172028     1.92   0.055    -.0047819    .4546448
      deidf3 |  -.6010406   .1188197    -5.06   0.000    -.8339229   -.3681583
      ddoar1 |   .0893913   .1564521     0.57   0.568    -.2172492    .3960317
      deida4 |  -.7257044   .1112926    -6.52   0.000    -.9438339   -.5075749
      ddowk5 |  -.0829784   .0226621    -3.66   0.000    -.1273953   -.0385614
      dnyrd1 |   .0810791   .1344068     0.60   0.546    -.1823534    .3445116
      darmd1 |  -.1562234   .1579185    -0.99   0.323    -.4657379    .1532911
      dlabd1 |     .01994   .1430171     0.14   0.889    -.2603684    .3002484
      drepd1 |  -.0623112   .1274253    -0.49   0.625    -.3120602    .1874379
      dindd1 |   .1895483   .1432421     1.32   0.186    -.0912011    .4702977
  irqelect30 |   .0991332   .0478789     2.07   0.038     .0052923    .1929741
   uselect30 |   .0852656   .0433368     1.97   0.049      .000327    .1702041
    oilprice |   .0036147   .0009288     3.89   0.000     .0017942    .0054351
  grainindex |  -.0020586   .0004672    -4.41   0.000    -.0029743   -.0011429
        temp |   .0002001   .0012037     0.17   0.868     -.002159    .0025593
        wesd |   .0008975   .0068593     0.13   0.896    -.0125465    .0143414
      precip |  -.0014402   .0024851    -0.58   0.562    -.0063109    .0034306
     tcloudc |  -.0004481   .0004325    -1.04   0.300    -.0012957    .0003995
 ctcoinactlg |  -.0050705   .0021932    -2.31   0.021     -.009369   -.0007719
    dprovid2 |  -.1337745   .0426597    -3.14   0.002     -.217386    -.050163
    dprovid3 |   1.462562   .0376377    38.86   0.000     1.388793     1.53633
    dprovid4 |   -.871348   .0513622   -16.96   0.000     -.972016     -.77068
    dprovid5 |  -4.902977   .3136226   -15.63   0.000    -5.517667   -4.288288
    dprovid6 |   .6400524   .0378798    16.90   0.000     .5658093    .7142955
    dprovid7 |  -3.477553   .1440613   -24.14   0.000    -3.759908   -3.195198
    dprovid8 |   -2.09177   .0907852   -23.04   0.000    -2.269706   -1.913835
    dprovid9 |  -2.533976   .1066012   -23.77   0.000    -2.742911   -2.325042
   dprovid10 |  -3.409822   .1554933   -21.93   0.000    -3.714583    -3.10506
   dprovid11 |   -2.50514   .1007585   -24.86   0.000    -2.702623   -2.307657
   dprovid12 |    .858433   .0372773    23.03   0.000     .7853709    .9314951
   dprovid13 |  -2.319562   .0904612   -25.64   0.000    -2.496863   -2.142262
   dprovid14 |   .2009485   .0403325     4.98   0.000     .1218982    .2799989
   dprovid15 |  -3.560876   .1617351   -22.02   0.000    -3.877871   -3.243881
   dprovid16 |   .3788255   .0379108     9.99   0.000     .3045218    .4531293
   dprovid17 |  -2.866517   .1196889   -23.95   0.000    -3.101103   -2.631931
   dprovid18 |  -1.478878   .0631914   -23.40   0.000     -1.60273   -1.355025
       d2005 |   1.004467   .0650138    15.45   0.000     .8770424    1.131892
       d2006 |   1.462639   .0910266    16.07   0.000     1.284231    1.641048
       d2007 |   1.443965   .1201757    12.02   0.000     1.208425    1.679505
       d2008 |   .7996128   .1555046     5.14   0.000     .4948294    1.104396
       d2009 |   .4555124   .1892767     2.41   0.016      .084537    .8264879
       d2010 |   .3315271   .2231754     1.49   0.137    -.1058886    .7689427
       d2011 |   .1010767     .26047     0.39   0.698    -.4094351    .6115885
       dayid |   .0003073   .0000993     3.09   0.002     .0001126     .000502
    ctwitslg |   .0796895   .0039092    20.38   0.000     .0720275    .0873515
       _cons |  -1.695966   .3688098    -4.60   0.000    -2.418819   -.9731116
-------------+----------------------------------------------------------------
    /lnalpha |  -1.040187   .0408252                     -1.120203   -.9601714
-------------+----------------------------------------------------------------
       alpha |   .3533885   .0144272                      .3262135    .3828273
------------------------------------------------------------------------------

Simulating main parameters.  Please wait....
% of simulations completed: 1% 3% 4% 6% 8% 9% 11% 13% 14% 16% 18% 19% 21% 22% 24% 26% 27% 29% 31% 32% 34% 36% 
> 37% 39% 40% 42% 44% 45% 47% 49% 50% 52% 54% 55% 57% 59% 60% 62% 63% 65% 67% 68% 70% 72% 73% 75% 77% 78% 80% 
> 81% 83% 85% 86% 88% 90% 91% 93% 95% 96% 98% 100% 

Number of simulations  : 1000
Names of new variables : b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 b18 b19 b20 b21 b22 b23 b2
> 4 b25 b26 b27 b28 b29 b30 b31 b32 b33 b34 b35 b36 b37 b38 b39 b40 b41 b42 b43 b44 b45 b46 b47 b48 b49 b50 b5
> 1 b52 b53 b54 b55 b56 b57 b58 b59 b60 b61

. quietly generate dropb=.

. order dropb

. setx mean

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk5 0 dnyrd1 0 darmd1 0 dlabd1 0 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local hbase=r(mean)

. quietly drop expval

. setx ddowk6 1 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk5 0 dnyrd1 0 darmd1 0 dlabd1 0 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Friday"
. display (r(mean)-`hbase')/`hbase'
-.33031269

. *
. quietly drop expval

. setx ddowk6 0 dhm01 1 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk5 0 dnyrd1 0 darmd1 0 dlabd1 0 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Muharram"
. display (r(mean)-`hbase')/`hbase'
-.08620751

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 1 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk5 0 dnyrd1 0 darmd1 0 dlabd1 0 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Dhu al-Qada"
. display (r(mean)-`hbase')/`hbase'
-.10156405

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 1 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk5 0 dnyrd1 0 darmd1 0 dlabd1 0 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Dhu al-Hijja"
. display (r(mean)-`hbase')/`hbase'
-.1314541

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 1 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 1 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk5 0 dnyrd1 0 darmd1 0 dlabd1 0 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "First Day of Ramadan"
. display (r(mean)-`hbase')/`hbase'
-.31989585

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 1 ddoar1 0 deida4 0 ddowk5 0 dnyrd1 0 darmd1 0 dlabd1 0 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Eid al-Fitr (3 Day)"
. display (r(mean)-`hbase')/`hbase'
-.44889112

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 1 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 1 ddowk5 0 dnyrd1 0 darmd1 0 dlabd1 0 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Eid al-Ahda (4 Day)"
. display (r(mean)-`hbase')/`hbase'
-.57622491

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk5 1 dnyrd1 0 darmd1 0 dlabd1 0 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Thursday"
. display (r(mean)-`hbase')/`hbase'
-.07922118

. *
. quietly drop expval

. quietly drop dropb-drope

. 
. 
. **Model 5
. clear matrix

. set seed 323

. quietly generate drope=.

. order drope

. estsimp nbreg ctgtd ddowk6 dhm01 dhm07 dhm09 dhm11 dhm12 dahny1 ddoas1 dmanu1 dmanh1 disam1 dlyab1 dfdor1 dl
> aqh1 dlaqu1 deidf3 ddoar1 deida4 ddowk5 dnyrd1 darmd1 dlabd1 drepd1 dindd1 irqelect30 uselect30 oilprice gra
> inindex temp wesd precip tcloudc ctcoinactlg dprovid2-dprovid18 d2005-d2014 dayid ctgtdlg if gyear>=2004 & g
> year<=2014, robust nolog

Negative binomial regression                    Number of obs     =     72,306
                                                Wald chi2(62)     =   10120.85
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood = -26970.495               Pseudo R2         =     0.2611

------------------------------------------------------------------------------
             |               Robust
       ctgtd |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      ddowk6 |  -.4198689   .0385087   -10.90   0.000    -.4953447   -.3443932
       dhm01 |   .1016129   .0483598     2.10   0.036     .0068295    .1963962
       dhm07 |   .0195167   .0450543     0.43   0.665     -.068788    .1078214
       dhm09 |   .1065166    .051581     2.07   0.039     .0054198    .2076135
       dhm11 |  -.0160156   .0489736    -0.33   0.744    -.1120021    .0799709
       dhm12 |  -.0232003    .052394    -0.44   0.658    -.1258907    .0794901
      dahny1 |  -.2054484   .2101149    -0.98   0.328     -.617266    .2063692
      ddoas1 |   .3212832   .2455672     1.31   0.191    -.1600197    .8025861
      dmanu1 |   .1361756   .2171864     0.63   0.531    -.2895021    .5618532
      dmanh1 |  -.0753024   .2102664    -0.36   0.720     -.487417    .3368121
      disam1 |  -.1993171   .2282233    -0.87   0.382    -.6466266    .2479925
      dlyab1 |   .0414963   .1787883     0.23   0.816    -.3089224     .391915
      dfdor1 |  -.4455793   .2572462    -1.73   0.083    -.9497726     .058614
      dlaqh1 |  -.4406834    .226717    -1.94   0.052    -.8850405    .0036736
      dlaqu1 |   .2421989    .216454     1.12   0.263    -.1820431    .6664409
      deidf3 |  -.4065782   .1556395    -2.61   0.009     -.711626   -.1015304
      ddoar1 |   .3084356   .1912943     1.61   0.107    -.0664943    .6833654
      deida4 |  -.3993829   .1506312    -2.65   0.008    -.6946147   -.1041511
      ddowk5 |  -.0170952   .0340871    -0.50   0.616    -.0839047    .0497144
      dnyrd1 |   .0894474   .2708024     0.33   0.741    -.4413155    .6202102
      darmd1 |   .1182211   .2169909     0.54   0.586    -.3070733    .5435155
      dlabd1 |  -.0046557   .1990604    -0.02   0.981    -.3948069    .3854955
      drepd1 |   .4277419   .2436467     1.76   0.079    -.0497968    .9052806
      dindd1 |   .1273737   .1727706     0.74   0.461    -.2112505    .4659979
  irqelect30 |   .0363496    .053278     0.68   0.495    -.0680733    .1407726
   uselect30 |  -.0797486   .0660537    -1.21   0.227    -.2092114    .0497142
    oilprice |   .0104692   .0012947     8.09   0.000     .0079317    .0130067
  grainindex |  -.0021617   .0006639    -3.26   0.001    -.0034628   -.0008605
        temp |  -.0033057    .001495    -2.21   0.027    -.0062359   -.0003755
        wesd |  -.0010011   .0127766    -0.08   0.938    -.0260428    .0240406
      precip |  -.0043591   .0039442    -1.11   0.269    -.0120896    .0033715
     tcloudc |   .0003629   .0006185     0.59   0.557    -.0008493    .0015751
 ctcoinactlg |  -.0033519   .0020097    -1.67   0.095    -.0072909    .0005871
    dprovid2 |  -.6407486   .0594102   -10.79   0.000    -.7571903   -.5243068
    dprovid3 |   1.256213   .0422116    29.76   0.000     1.173479    1.338946
    dprovid4 |  -1.785989   .0917612   -19.46   0.000    -1.965838    -1.60614
    dprovid5 |  -7.239277   1.001293    -7.23   0.000    -9.201776   -5.276779
    dprovid6 |   .2462207   .0464529     5.30   0.000     .1551746    .3372667
    dprovid7 |  -3.678907   .2592777   -14.19   0.000    -4.187082   -3.170732
    dprovid8 |  -2.409759   .1173246   -20.54   0.000    -2.639711   -2.179807
    dprovid9 |  -3.915374   .2093579   -18.70   0.000    -4.325708    -3.50504
   dprovid10 |  -4.715627   .3140414   -15.02   0.000    -5.331137   -4.100117
   dprovid11 |  -3.349894   .1652343   -20.27   0.000    -3.673747   -3.026041
   dprovid12 |   .2459743   .0455549     5.40   0.000     .1566883    .3352603
   dprovid13 |   -3.95459   .2365109   -16.72   0.000    -4.418143   -3.491037
   dprovid14 |   .2211873   .0471406     4.69   0.000     .1287935    .3135811
   dprovid15 |   -4.09268   .2188716   -18.70   0.000     -4.52166   -3.663699
   dprovid16 |  -.1218706   .0528722    -2.31   0.021    -.2254983   -.0182429
   dprovid17 |  -3.329398    .167418   -19.89   0.000    -3.657531   -3.001265
   dprovid18 |   -2.48797   .1239486   -20.07   0.000    -2.730905   -2.245035
       d2005 |   .3257944   .1012202     3.22   0.001     .1274064    .5241823
       d2006 |    .328318   .1344229     2.44   0.015     .0648539    .5917821
       d2007 |   .5062281   .1746645     2.90   0.004     .1638919    .8485643
       d2008 |   .3258106   .2297036     1.42   0.156    -.1244002    .7760214
       d2009 |   .4581263   .2690046     1.70   0.089    -.0691129    .9853656
       d2010 |   .1433088   .3172882     0.45   0.652    -.4785646    .7651823
       d2011 |  -.0666041   .3736307    -0.18   0.859    -.7989068    .6656985
       d2012 |   .0095826   .4239924     0.02   0.982    -.8214273    .8405925
       d2013 |    .443804   .4713099     0.94   0.346    -.4799464    1.367554
       d2014 |   .6336864   .5172438     1.23   0.221    -.3800928    1.647466
       dayid |   .0003932   .0001387     2.83   0.005     .0001214    .0006651
     ctgtdlg |   .1348176    .009666    13.95   0.000     .1158725    .1537627
       _cons |  -1.747483   .4482854    -3.90   0.000    -2.626106     -.86886
-------------+----------------------------------------------------------------
    /lnalpha |   .2431589    .032713                      .1790427    .3072751
-------------+----------------------------------------------------------------
       alpha |   1.275271   .0417179                      1.196072    1.359715
------------------------------------------------------------------------------

Simulating main parameters.  Please wait....
% of simulations completed: 1% 3% 4% 6% 7% 9% 10% 12% 14% 15% 17% 18% 20% 21% 23% 25% 26% 28% 29% 31% 32% 34% 
> 35% 37% 39% 40% 42% 43% 45% 46% 48% 50% 51% 53% 54% 56% 57% 59% 60% 62% 64% 65% 67% 68% 70% 71% 73% 75% 76% 
> 78% 79% 81% 82% 84% 85% 87% 89% 90% 92% 93% 95% 96% 98% 100% 

Number of simulations  : 1000
Names of new variables : b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 b18 b19 b20 b21 b22 b23 b2
> 4 b25 b26 b27 b28 b29 b30 b31 b32 b33 b34 b35 b36 b37 b38 b39 b40 b41 b42 b43 b44 b45 b46 b47 b48 b49 b50 b5
> 1 b52 b53 b54 b55 b56 b57 b58 b59 b60 b61 b62 b63 b64

. quietly generate dropb=.

. order dropb

. setx mean

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk5 0 dnyrd1 0 darmd1 0 dlabd1 0 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local hbase=r(mean)

. quietly drop expval

. setx ddowk6 1 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk5 0 dnyrd1 0 darmd1 0 dlabd1 0 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Friday"
. display (r(mean)-`hbase')/`hbase'
-.34262014

. *
. quietly drop expval

. setx ddowk6 0 dhm01 1 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk5 0 dnyrd1 0 darmd1 0 dlabd1 0 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Muharram"
. display (r(mean)-`hbase')/`hbase'
.10870699

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 1 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk5 0 dnyrd1 0 darmd1 0 dlabd1 0 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Ramadan"
. display (r(mean)-`hbase')/`hbase'
.11358164

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 1 ddoar1 0 deida4 0 ddowk5 0 dnyrd1 0 darmd1 0 dlabd1 0 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Eid al-Fitr (3 Day)"
. display (r(mean)-`hbase')/`hbase'
-.32784976

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 1 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 1 ddowk5 0 dnyrd1 0 darmd1 0 dlabd1 0 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Eid al-Ahda (4 Day)"
. display (r(mean)-`hbase')/`hbase'
-.33630777

. *
. quietly drop expval

. quietly drop dropb-drope

. 
. 
. **Model 6
. clear matrix

. set seed 323

. quietly generate drope=.

. order drope

. estsimp nbreg ctibc ddowk6 dhm01 dhm07 dhm09 dhm11 dhm12 dahny1 ddoas1 dmanu1 dmanh1 disam1 dlyab1 dfdor1 dl
> aqh1 dlaqu1 deidf3 ddoar1 deida4 ddowk5 dnyrd1 darmd1 dlabd1 drepd1 dindd1 irqelect30 uselect30 oilprice gra
> inindex temp wesd precip tcloudc ctcoinactlg dprovid2-dprovid18 d2005-d2009 dayid ctibclg if (gyear>=2004 & 
> gyear<=2008) | (gyear==2009 & gnummnth<=6), robust nolog

Negative binomial regression                    Number of obs     =     36,126
                                                Wald chi2(57)     =   20752.52
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood =  -22236.75               Pseudo R2         =     0.3083

------------------------------------------------------------------------------
             |               Robust
       ctibc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      ddowk6 |   -.320627   .0295438   -10.85   0.000    -.3785317   -.2627223
       dhm01 |  -.1333267   .0431656    -3.09   0.002    -.2179297   -.0487236
       dhm07 |   .1044989   .0376015     2.78   0.005     .0308014    .1781965
       dhm09 |   .0213104   .0370222     0.58   0.565    -.0512518    .0938727
       dhm11 |  -.0866042   .0467635    -1.85   0.064     -.178259    .0050506
       dhm12 |  -.2713026   .0474253    -5.72   0.000    -.3642545   -.1783507
      dahny1 |  -.1703546   .2005115    -0.85   0.396    -.5633499    .2226407
      ddoas1 |   .0004672   .1962434     0.00   0.998    -.3841628    .3850972
      dmanu1 |     .00428   .1828922     0.02   0.981    -.3541821    .3627422
      dmanh1 |  -.1081928   .1912314    -0.57   0.572    -.4829993    .2666138
      disam1 |  -.5276203   .1936058    -2.73   0.006    -.9070807   -.1481599
      dlyab1 |  -.0312182   .1605967    -0.19   0.846     -.345982    .2835455
      dfdor1 |  -.2540433   .1673848    -1.52   0.129    -.5821114    .0740249
      dlaqh1 |  -.0326358   .1603642    -0.20   0.839    -.3469439    .2816722
      dlaqu1 |   .2556827   .1575074     1.62   0.105    -.0530261    .5643915
      deidf3 |  -.3930349   .1271782    -3.09   0.002    -.6422997   -.1437701
      ddoar1 |  -.1778322   .1963717    -0.91   0.365    -.5627137    .2070493
      deida4 |  -.7561166   .1669329    -4.53   0.000    -1.083299   -.4289342
      ddowk5 |  -.0548992   .0266486    -2.06   0.039    -.1071295    -.002669
      dnyrd1 |   .2282619   .1852266     1.23   0.218    -.1347757    .5912995
      darmd1 |  -.1156086   .2045018    -0.57   0.572    -.5164247    .2852075
      dlabd1 |  -.4042635   .1861867    -2.17   0.030    -.7691829   -.0393442
      drepd1 |   .1372309   .1465012     0.94   0.349    -.1499061     .424368
      dindd1 |   .1514205   .1436705     1.05   0.292    -.1301686    .4330095
  irqelect30 |   .0444633   .0649071     0.69   0.493    -.0827522    .1716789
   uselect30 |   .1673035     .05155     3.25   0.001     .0662672    .2683397
    oilprice |  -.0002085   .0012511    -0.17   0.868    -.0026606    .0022435
  grainindex |   .0008831   .0006393     1.38   0.167      -.00037    .0021362
        temp |  -.0033559   .0014839    -2.26   0.024    -.0062643   -.0004474
        wesd |   .0097007   .0093139     1.04   0.298    -.0085543    .0279556
      precip |  -.0065534   .0028191    -2.32   0.020    -.0120788    -.001028
     tcloudc |  -.0015355   .0005403    -2.84   0.004    -.0025944   -.0004765
 ctcoinactlg |   .0003433   .0013158     0.26   0.794    -.0022355    .0029221
    dprovid2 |    .232169   .0475594     4.88   0.000     .1389542    .3253837
    dprovid3 |   1.761934   .0436003    40.41   0.000     1.676479    1.847389
    dprovid4 |  -.6588907    .061736   -10.67   0.000    -.7798911   -.5378903
    dprovid5 |  -5.199936   .5339709    -9.74   0.000    -6.246499   -4.153372
    dprovid6 |   .9205243   .0416185    22.12   0.000     .8389534    1.002095
    dprovid7 |  -3.160304   .1657302   -19.07   0.000    -3.485129   -2.835478
    dprovid8 |  -1.889413   .0975732   -19.36   0.000    -2.080653   -1.698173
    dprovid9 |  -2.035394   .1040478   -19.56   0.000    -2.239324   -1.831464
   dprovid10 |  -3.151711   .1899048   -16.60   0.000    -3.523917   -2.779504
   dprovid11 |  -1.980322   .1068384   -18.54   0.000    -2.189721   -1.770923
   dprovid12 |   .9119649   .0437376    20.85   0.000     .8262408     .997689
   dprovid13 |  -1.578068   .0863564   -18.27   0.000    -1.747324   -1.408813
   dprovid14 |   .3302907   .0477388     6.92   0.000     .2367243    .4238571
   dprovid15 |  -3.311499   .1784599   -18.56   0.000    -3.661274   -2.961724
   dprovid16 |   .1450291   .0474672     3.06   0.002     .0519951    .2380631
   dprovid17 |  -2.850577   .1514627   -18.82   0.000    -3.147439   -2.553716
   dprovid18 |  -.5376217   .0594509    -9.04   0.000    -.6541433   -.4211001
       d2005 |   .8402673   .0804692    10.44   0.000     .6825506    .9979841
       d2006 |   1.686547   .1197585    14.08   0.000     1.451825     1.92127
       d2007 |   1.813285   .1588089    11.42   0.000     1.502025    2.124545
       d2008 |   1.131767   .1999085     5.66   0.000     .7399532     1.52358
       d2009 |   .6353649    .241515     2.63   0.009     .1620043    1.108726
       dayid |  -.0000639   .0001331    -0.48   0.631    -.0003248     .000197
     ctibclg |   .0730739   .0038693    18.89   0.000     .0654902    .0806576
       _cons |  -1.035225   .4567698    -2.27   0.023    -1.930477   -.1399723
-------------+----------------------------------------------------------------
    /lnalpha |  -1.357383   .0614568                     -1.477836    -1.23693
-------------+----------------------------------------------------------------
       alpha |   .2573334   .0158149                      .2281309    .2902741
------------------------------------------------------------------------------

Simulating main parameters.  Please wait....
% of simulations completed: 1% 3% 5% 6% 8% 10% 11% 13% 15% 16% 18% 20% 22% 23% 25% 27% 28% 30% 32% 33% 35% 37%
>  38% 40% 42% 44% 45% 47% 49% 50% 52% 54% 55% 57% 59% 61% 62% 64% 66% 67% 69% 71% 72% 74% 76% 77% 79% 81% 83%
>  84% 86% 88% 89% 91% 93% 94% 96% 98% 100% 

Number of simulations  : 1000
Names of new variables : b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 b18 b19 b20 b21 b22 b23 b2
> 4 b25 b26 b27 b28 b29 b30 b31 b32 b33 b34 b35 b36 b37 b38 b39 b40 b41 b42 b43 b44 b45 b46 b47 b48 b49 b50 b5
> 1 b52 b53 b54 b55 b56 b57 b58 b59

. quietly generate dropb=.

. order dropb

. setx mean

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk5 0 dnyrd1 0 darmd1 0 dlabd1 0 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local hbase=r(mean)

. quietly drop expval

. setx ddowk6 1 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk5 0 dnyrd1 0 darmd1 0 dlabd1 0 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Friday"
. display (r(mean)-`hbase')/`hbase'
-.27418391

. *
. quietly drop expval

. setx ddowk6 0 dhm01 1 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk5 0 dnyrd1 0 darmd1 0 dlabd1 0 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Muharram"
. display (r(mean)-`hbase')/`hbase'
-.12344277

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 1 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk5 0 dnyrd1 0 darmd1 0 dlabd1 0 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Rajab"
. display (r(mean)-`hbase')/`hbase'
.11208241

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 1 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk5 0 dnyrd1 0 darmd1 0 dlabd1 0 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Dhu al-Hijja"
. display (r(mean)-`hbase')/`hbase'
-.2378687

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 1 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 1 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk5 0 dnyrd1 0 darmd1 0 dlabd1 0 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Isra and Mi'raj"
. display (r(mean)-`hbase')/`hbase'
-.33244241

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 1 ddoar1 0 deida4 0 ddowk5 0 dnyrd1 0 darmd1 0 dlabd1 0 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Eid al-Fitr (3 Day)"
. display (r(mean)-`hbase')/`hbase'
-.32091428

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 1 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 1 ddowk5 0 dnyrd1 0 darmd1 0 dlabd1 0 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Eid al-Ahda (4 Day)"
. display (r(mean)-`hbase')/`hbase'
-.63620345

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk5 1 dnyrd1 0 darmd1 0 dlabd1 0 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Thursday"
. display (r(mean)-`hbase')/`hbase'
-.05284082

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk5 0 dnyrd1 0 darmd1 0 dlabd1 1 drepd1 0 dindd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Labor Day"
. display (r(mean)-`hbase')/`hbase'
-.31867134

. *
. quietly drop expval

. quietly drop dropb-drope

. 
. 
. ***Pakistan Models
. 
. use RRP-APSR-RepData-2017-04-04-PAK.dta, clear

. 
. **Model 7
. clear matrix

. set seed 323

. quietly generate drope=.

. order drope

. estsimp nbreg ctwits ddowk6 dhm01 dhm07 dhm09 dhm11 dhm12 dahny1 ddoas1 dmanu1 dmanh1 disam1 dlyab1 dfdor1 d
> laqh1 dlaqu1 deidf3 ddoar1 deida4 ddowk1 dkhsd1 dpakd1 dlabd1 dindd1 daidd1 dqabd1 pakelect30 uselect30 oilp
> rice grainindex temp wesd precip tcloudc ctcoinactlg dproid2-dproid8 d2005-d2011 dayid ctwitslg if gyear>=20
> 04 & gyear<=2011, robust nolog

Negative binomial regression                    Number of obs     =     23,368
                                                Wald chi2(50)     =    5208.50
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood = -12650.211               Pseudo R2         =     0.2709

------------------------------------------------------------------------------
             |               Robust
      ctwits |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      ddowk6 |   -.000273   .0397604    -0.01   0.995     -.078202     .077656
       dhm01 |  -.0223107   .0577242    -0.39   0.699     -.135448    .0908266
       dhm07 |   .0325606    .052938     0.62   0.539    -.0711959    .1363171
       dhm09 |  -.0584685   .0590166    -0.99   0.322    -.1741389    .0572019
       dhm11 |   .0528637   .0592122     0.89   0.372      -.06319    .1689175
       dhm12 |   .0994189   .0697426     1.43   0.154    -.0372741    .2361118
      dahny1 |  -.3673252   .3617611    -1.02   0.310    -1.076364    .3417135
      ddoas1 |  -.0857033   .2534091    -0.34   0.735     -.582376    .4109693
      dmanu1 |  -.3579231   .2751971    -1.30   0.193    -.8972994    .1814533
      dmanh1 |   -.416497   .3994295    -1.04   0.297    -1.199364    .3663704
      disam1 |   -.070558   .2600506    -0.27   0.786    -.5802477    .4391318
      dlyab1 |  -.2529443   .2950852    -0.86   0.391    -.8313007     .325412
      dfdor1 |  -.0449423     .21795    -0.21   0.837    -.4721165    .3822319
      dlaqh1 |   .3787209   .2490247     1.52   0.128    -.1093586    .8668004
      dlaqu1 |  -.2620208    .249878    -1.05   0.294    -.7517727     .227731
      deidf3 |  -.3512591   .1795762    -1.96   0.050     -.703222    .0007038
      ddoar1 |  -.3036953   .2437756    -1.25   0.213    -.7814866     .174096
      deida4 |    -.26397   .1407747    -1.88   0.061    -.5398832    .0119433
      ddowk1 |  -.0533191   .0390808    -1.36   0.172    -.1299161    .0232778
      dkhsd1 |   .3335203   .2332443     1.43   0.153    -.1236301    .7906707
      dpakd1 |   .3158875   .2114767     1.49   0.135    -.0985993    .7303742
      dlabd1 |   .1896819   .2123972     0.89   0.372     -.226609    .6059729
      dindd1 |   .8278887   .3326236     2.49   0.013     .1759585    1.479819
      daidd1 |   .4415964     .21713     2.03   0.042     .0160295    .8671633
      dqabd1 |   .0657923   .2685724     0.24   0.806       -.4606    .5921846
  pakelect30 |  -.0046534   .0929163    -0.05   0.960    -.1867659    .1774591
   uselect30 |  -.1712594   .0836633    -2.05   0.041    -.3352365   -.0072822
    oilprice |  -.0059166   .0014814    -3.99   0.000    -.0088201   -.0030131
  grainindex |   .0028473   .0007444     3.82   0.000     .0013883    .0043063
        temp |   .0054816   .0030254     1.81   0.070    -.0004481    .0114114
        wesd |  -.0057156   .0042678    -1.34   0.180    -.0140803    .0026491
      precip |  -.0056481   .0034923    -1.62   0.106    -.0124929    .0011968
     tcloudc |   .0009815    .000773     1.27   0.204    -.0005336    .0024967
 ctcoinactlg |   .0077114   .0017702     4.36   0.000     .0042419    .0111809
     dproid2 |   5.979244   .5285162    11.31   0.000     4.943372    7.015117
     dproid3 |   .0930611   .6675043     0.14   0.889    -1.215223    1.401345
     dproid4 |   5.516378   .5291891    10.42   0.000     4.479186    6.553569
     dproid5 |   2.380027   .5454169     4.36   0.000      1.31103    3.449025
     dproid6 |   3.948296   .5332457     7.40   0.000     2.903154    4.993439
     dproid7 |   5.943266   .5302865    11.21   0.000     4.903924    6.982609
     dproid8 |   4.305857   .5330501     8.08   0.000     3.261098    5.350616
       d2005 |   1.364227   .1449209     9.41   0.000     1.080187    1.648267
       d2006 |   1.361411   .1883068     7.23   0.000     .9923368    1.730486
       d2007 |   2.238381   .2349226     9.53   0.000     1.777941    2.698821
       d2008 |   2.903226   .3026729     9.59   0.000     2.309998    3.496454
       d2009 |   3.012785   .3670284     8.21   0.000     2.293422    3.732147
       d2010 |   3.015151   .4280302     7.04   0.000     2.176227    3.854075
       d2011 |   3.247648   .4977241     6.52   0.000     2.272126    4.223169
       dayid |  -.0004426   .0001875    -2.36   0.018    -.0008101   -.0000751
    ctwitslg |   .1482904    .009564    15.50   0.000     .1295452    .1670356
       _cons |   -8.14298    .545275   -14.93   0.000      -9.2117   -7.074261
-------------+----------------------------------------------------------------
    /lnalpha |  -.7155115   .0629643                     -.8389191   -.5921038
-------------+----------------------------------------------------------------
       alpha |    .488942   .0307859                      .4321774    .5531623
------------------------------------------------------------------------------

Simulating main parameters.  Please wait....
% of simulations completed: 1% 3% 5% 7% 9% 11% 13% 15% 17% 19% 21% 23% 25% 26% 28% 30% 32% 34% 36% 38% 40% 42%
>  44% 46% 48% 50% 51% 53% 55% 57% 59% 61% 63% 65% 67% 69% 71% 73% 75% 76% 78% 80% 82% 84% 86% 88% 90% 92% 94%
>  96% 98% 100% 

Number of simulations  : 1000
Names of new variables : b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 b18 b19 b20 b21 b22 b23 b2
> 4 b25 b26 b27 b28 b29 b30 b31 b32 b33 b34 b35 b36 b37 b38 b39 b40 b41 b42 b43 b44 b45 b46 b47 b48 b49 b50 b5
> 1 b52

. quietly generate dropb=.

. order dropb

. setx mean

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk1 0 dkhsd1 0 dpakd1 0 dlabd1 0 dindd1 0 daidd1 0 
> dqabd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local hbase=r(mean)

. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 1 ddoar1 0 deida4 0 ddowk1 0 dkhsd1 0 dpakd1 0 dlabd1 0 dindd1 0 daidd1 0 
> dqabd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Eid al-Fitr (3 Day)"
. display (r(mean)-`hbase')/`hbase'
-.28660557

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk1 0 dkhsd1 0 dpakd1 0 dlabd1 0 dindd1 1 daidd1 0 
> dqabd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Independence Day"
. display (r(mean)-`hbase')/`hbase'
1.3809152

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk1 0 dkhsd1 0 dpakd1 0 dlabd1 0 dindd1 0 daidd1 1 
> dqabd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Allama Iqbal Day"
. display (r(mean)-`hbase')/`hbase'
.58091802

. *
. quietly drop expval

. quietly drop dropb-drope

. 
. 
. **Model 8
. clear matrix

. set seed 323

. quietly generate drope=.

. order drope

. estsimp nbreg ctgtd ddowk6 dhm01 dhm07 dhm09 dhm11 dhm12 dahny1 ddoas1 dmanu1 dmanh1 disam1 dlyab1 dfdor1 dl
> aqh1 dlaqu1 deidf3 ddoar1 deida4 ddowk1 dkhsd1 dpakd1 dlabd1 dindd1 daidd1 dqabd1 pakelect30 uselect30 oilpr
> ice grainindex temp wesd precip tcloudc ctcoinactlg dproid2-dproid8 d2005-d2014 dayid ctgtdlg if gyear>=2004
>  & gyear<=2014, robust nolog

Negative binomial regression                    Number of obs     =     32,136
                                                Wald chi2(53)     =    6189.62
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood = -15319.259               Pseudo R2         =     0.2688

------------------------------------------------------------------------------
             |               Robust
       ctgtd |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      ddowk6 |  -.0581812   .0379602    -1.53   0.125    -.1325817    .0162194
       dhm01 |  -.0124214    .053662    -0.23   0.817     -.117597    .0927541
       dhm07 |   -.047044   .0539495    -0.87   0.383     -.152783     .058695
       dhm09 |  -.0627966    .055893    -1.12   0.261    -.1723448    .0467516
       dhm11 |   .1240874   .0518577     2.39   0.017     .0224482    .2257267
       dhm12 |   .1234704   .0724313     1.70   0.088    -.0184924    .2654332
      dahny1 |   .0397411   .3395231     0.12   0.907     -.625712    .7051942
      ddoas1 |   .2493419   .2553269     0.98   0.329    -.2510896    .7497735
      dmanu1 |  -.7116266   .3091095    -2.30   0.021     -1.31747   -.1057832
      dmanh1 |  -.4057189   .2599969    -1.56   0.119    -.9153035    .1038657
      disam1 |    .252582   .1966632     1.28   0.199    -.1328708    .6380348
      dlyab1 |   .2722918   .2065513     1.32   0.187    -.1325413    .6771249
      dfdor1 |   .0136081   .1887248     0.07   0.943    -.3562857    .3835019
      dlaqh1 |   .1041804   .1870937     0.56   0.578    -.2625166    .4708773
      dlaqu1 |   .5886257   .2234508     2.63   0.008     .1506702    1.026581
      deidf3 |  -.7303516   .1666182    -4.38   0.000    -1.056917    -.403786
      ddoar1 |  -.5578337   .2662777    -2.09   0.036    -1.079728    -.035939
      deida4 |  -.3973421   .1711272    -2.32   0.020    -.7327453   -.0619389
      ddowk1 |  -.0727745   .0392347    -1.85   0.064    -.1496731    .0041242
      dkhsd1 |   -.203987   .3378731    -0.60   0.546    -.8662062    .4582322
      dpakd1 |  -.1308004   .2432906    -0.54   0.591    -.6076413    .3460404
      dlabd1 |   .0688338   .1888437     0.36   0.715    -.3012932    .4389607
      dindd1 |   .5563803   .2940108     1.89   0.058    -.0198703    1.132631
      daidd1 |   .2395595   .2623355     0.91   0.361    -.2746086    .7537276
      dqabd1 |  -.2292734   .2356141    -0.97   0.331    -.6910684    .2325217
  pakelect30 |   .3427215   .0739323     4.64   0.000     .1978168    .4876263
   uselect30 |  -.0890813   .0743492    -1.20   0.231    -.2348031    .0566404
    oilprice |  -.0032837   .0014049    -2.34   0.019    -.0060373   -.0005301
  grainindex |   .0007539   .0007297     1.03   0.302    -.0006764    .0021841
        temp |    .000369   .0024744     0.15   0.881    -.0044808    .0052187
        wesd |   .0025739   .0042078     0.61   0.541    -.0056733    .0108211
      precip |  -.0142322   .0042905    -3.32   0.001    -.0226414    -.005823
     tcloudc |   .0009021   .0007459     1.21   0.226    -.0005598    .0023641
 ctcoinactlg |   .0047139   .0022505     2.09   0.036      .000303    .0091248
     dproid2 |   4.407416   .2063185    21.36   0.000     4.003039    4.811793
     dproid3 |  -1.877502   .4922615    -3.81   0.000    -2.842316   -.9126869
     dproid4 |   3.950102   .2106878    18.75   0.000     3.537162    4.363043
     dproid5 |   .8395074   .2428265     3.46   0.001     .3635762    1.315439
     dproid6 |   2.343082   .2219994    10.55   0.000     1.907972    2.778193
     dproid7 |   4.198656   .2143268    19.59   0.000     3.778583    4.618729
     dproid8 |   3.719889   .2175759    17.10   0.000     3.293448     4.14633
       d2005 |   .3014953   .2081672     1.45   0.148    -.1065048    .7094955
       d2006 |   1.173093   .2203864     5.32   0.000     .7411438    1.605042
       d2007 |   1.671997   .2417637     6.92   0.000     1.198149    2.145845
       d2008 |   2.497665   .3042087     8.21   0.000     1.901427    3.093903
       d2009 |   2.728352   .3398047     8.03   0.000     2.062347    3.394357
       d2010 |    2.96785   .3977426     7.46   0.000     2.188289    3.747411
       d2011 |   3.447811   .4657871     7.40   0.000     2.534886    4.360737
       d2012 |   3.986793   .5237857     7.61   0.000     2.960192    5.013394
       d2013 |   4.274692    .572973     7.46   0.000     3.151686    5.397699
       d2014 |   4.411955   .6252801     7.06   0.000     3.186429    5.637482
       dayid |  -.0002625   .0001596    -1.65   0.100    -.0005752    .0000502
     ctgtdlg |   .0990721    .011396     8.69   0.000     .0767363    .1214078
       _cons |  -7.183895   .2747553   -26.15   0.000    -7.722406   -6.645385
-------------+----------------------------------------------------------------
    /lnalpha |    -.48483   .0719573                     -.6258639   -.3437962
-------------+----------------------------------------------------------------
       alpha |   .6158018   .0443115                      .5347992    .7090734
------------------------------------------------------------------------------

Simulating main parameters.  Please wait....
% of simulations completed: 1% 3% 5% 7% 9% 10% 12% 14% 16% 18% 20% 21% 23% 25% 27% 29% 30% 32% 34% 36% 38% 40%
>  41% 43% 45% 47% 49% 50% 52% 54% 56% 58% 60% 61% 63% 65% 67% 69% 70% 72% 74% 76% 78% 80% 81% 83% 85% 87% 89%
>  90% 92% 94% 96% 98% 100% 

Number of simulations  : 1000
Names of new variables : b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 b18 b19 b20 b21 b22 b23 b2
> 4 b25 b26 b27 b28 b29 b30 b31 b32 b33 b34 b35 b36 b37 b38 b39 b40 b41 b42 b43 b44 b45 b46 b47 b48 b49 b50 b5
> 1 b52 b53 b54 b55

. quietly generate dropb=.

. order dropb

. setx mean

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk1 0 dkhsd1 0 dpakd1 0 dlabd1 0 dindd1 0 daidd1 0 
> dqabd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local hbase=r(mean)

. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 1 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk1 0 dkhsd1 0 dpakd1 0 dlabd1 0 dindd1 0 daidd1 0 
> dqabd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Dhu al-Qada"
. display (r(mean)-`hbase')/`hbase'
.13514191

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 1 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk1 0 dkhsd1 0 dpakd1 0 dlabd1 0 dindd1 0 daidd1 0 
> dqabd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Mawlid an Nabi (Sunni)"
. display (r(mean)-`hbase')/`hbase'
-.47792394

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 1 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 1 deidf3 0 ddoar1 0 deida4 0 ddowk1 0 dkhsd1 0 dpakd1 0 dlabd1 0 dindd1 0 daidd1 0 
> dqabd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Laylat al-Qadar (Sunni)"
. display (r(mean)-`hbase')/`hbase'
.73195592

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 1 ddoar1 0 deida4 0 ddowk1 0 dkhsd1 0 dpakd1 0 dlabd1 0 dindd1 0 daidd1 0 
> dqabd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Eid al-Fitr (3 Day)"
. display (r(mean)-`hbase')/`hbase'
-.51268347

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 1 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 1 deida4 0 ddowk1 0 dkhsd1 0 dpakd1 0 dlabd1 0 dindd1 0 daidd1 0 
> dqabd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Day of Arafah"
. display (r(mean)-`hbase')/`hbase'
-.32692445

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 1 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 1 ddowk1 0 dkhsd1 0 dpakd1 0 dlabd1 0 dindd1 0 daidd1 0 
> dqabd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Eid al-Ahda (4 Day)"
. display (r(mean)-`hbase')/`hbase'
-.22761516

. *
. quietly drop expval

. quietly drop dropb-drope

. 
. 
. **Model 9
. clear matrix

. set seed 323

. quietly generate drope=.

. order drope

. estsimp nbreg ctpips ddowk6 dhm01 dhm07 dhm09 dhm11 dhm12 dahny1 ddoas1 dmanu1 dmanh1 disam1 dlyab1 dfdor1 d
> laqh1 dlaqu1 deidf3 ddoar1 deida4 ddowk1 dkhsd1 dpakd1 dlabd1 dindd1 daidd1 dqabd1 pakelect30 uselect30 oilp
> rice grainindex temp wesd precip tcloudc ctcoinactlg dproid2-dproid8 d2005-d2014 dayid ctpipslg if gyear>=20
> 04 & gyear<=2014, robust nolog

Negative binomial regression                    Number of obs     =     32,136
                                                Wald chi2(53)     =    9927.67
Dispersion           = mean                     Prob > chi2       =     0.0000
Log pseudolikelihood = -21799.721               Pseudo R2         =     0.3241

------------------------------------------------------------------------------
             |               Robust
      ctpips |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      ddowk6 |  -.0289214   .0255645    -1.13   0.258    -.0790268     .021184
       dhm01 |  -.1482295   .0371671    -3.99   0.000    -.2210756   -.0753834
       dhm07 |   .0339514   .0334557     1.01   0.310    -.0316205    .0995234
       dhm09 |   .0291528   .0364724     0.80   0.424    -.0423317    .1006373
       dhm11 |   .0524319   .0364617     1.44   0.150    -.0190317    .1238955
       dhm12 |  -.0828594   .0393447    -2.11   0.035    -.1599735   -.0057452
      dahny1 |   .0704244   .1516106     0.46   0.642    -.2267268    .3675757
      ddoas1 |  -.8622997   .2156997    -4.00   0.000    -1.285063    -.439536
      dmanu1 |  -.7636895   .3227261    -2.37   0.018    -1.396221    -.131158
      dmanh1 |  -.0920954   .1469721    -0.63   0.531    -.3801554    .1959647
      disam1 |  -.3004025    .182871    -1.64   0.100    -.6588232    .0580181
      dlyab1 |   .1042204   .1759144     0.59   0.554    -.2405656    .4490064
      dfdor1 |  -.3852496   .1945906    -1.98   0.048    -.7666402   -.0038591
      dlaqh1 |   .0428037   .1635029     0.26   0.793    -.2776561    .3632635
      dlaqu1 |   .2728284   .1663753     1.64   0.101    -.0532612    .5989179
      deidf3 |  -.3616683   .1224947    -2.95   0.003    -.6017536    -.121583
      ddoar1 |  -.2922978   .2137315    -1.37   0.171    -.7112038    .1266083
      deida4 |  -.2899719    .116599    -2.49   0.013    -.5185017    -.061442
      ddowk1 |   .0177503   .0239154     0.74   0.458     -.029123    .0646235
      dkhsd1 |    .193564   .1297444     1.49   0.136    -.0607303    .4478584
      dpakd1 |   .1030205    .156407     0.66   0.510    -.2035316    .4095727
      dlabd1 |  -.1247413   .1371254    -0.91   0.363    -.3935021    .1440195
      dindd1 |   .2478671   .1769283     1.40   0.161     -.098906    .5946401
      daidd1 |   .2711176   .1422859     1.91   0.057    -.0077577    .5499929
      dqabd1 |  -.0455056   .1669623    -0.27   0.785    -.3727457    .2817346
  pakelect30 |   .2310785   .0572655     4.04   0.000       .11884    .3433169
   uselect30 |  -.0728439   .0484826    -1.50   0.133     -.167868    .0221803
    oilprice |  -.0011533   .0008285    -1.39   0.164    -.0027771    .0004706
  grainindex |   .0002938   .0004285     0.69   0.493    -.0005462    .0011337
        temp |  -.0002437   .0016754    -0.15   0.884    -.0035274      .00304
        wesd |   .0009839   .0028001     0.35   0.725    -.0045043     .006472
      precip |  -.0059318   .0027956    -2.12   0.034    -.0114112   -.0004525
     tcloudc |   .0011329   .0004906     2.31   0.021     .0001713    .0020944
 ctcoinactlg |   .0069492   .0011553     6.02   0.000     .0046849    .0092135
     dproid2 |   3.844451   .1256609    30.59   0.000      3.59816    4.090741
     dproid3 |   .3504239   .1559905     2.25   0.025     .0446882    .6561597
     dproid4 |   3.735272   .1284654    29.08   0.000     3.483484    3.987059
     dproid5 |  -.2672262   .1788483    -1.49   0.135    -.6177625    .0833101
     dproid6 |   1.612774   .1395594    11.56   0.000     1.339243    1.886306
     dproid7 |   3.805038   .1312347    28.99   0.000     3.547823    4.062253
     dproid8 |   3.146952   .1331187    23.64   0.000     2.886044     3.40786
       d2005 |  -.0078893   .4352801    -0.02   0.986    -.8610226     .845244
       d2006 |    2.62712   .3211999     8.18   0.000     1.997579     3.25666
       d2007 |   4.398095   .3266011    13.47   0.000     3.757969    5.038222
       d2008 |   4.702156   .3454203    13.61   0.000     4.025144    5.379167
       d2009 |   4.766232   .3645157    13.08   0.000     4.051795     5.48067
       d2010 |   4.620137   .3879115    11.91   0.000     3.859845     5.38043
       d2011 |   4.524692   .4168928    10.85   0.000     3.707597    5.341787
       d2012 |   4.212386   .4453562     9.46   0.000     3.339504    5.085268
       d2013 |   4.231008   .4751053     8.91   0.000     3.299819    5.162198
       d2014 |   3.949292   .5063448     7.80   0.000     2.956874    4.941709
       dayid |   .0003011   .0001108     2.72   0.007     .0000839    .0005182
    ctpipslg |   .1210619   .0052114    23.23   0.000     .1108478    .1312759
       _cons |  -8.656185    .333563   -25.95   0.000    -9.309956   -8.002414
-------------+----------------------------------------------------------------
    /lnalpha |  -1.430538   .0560499                     -1.540394   -1.320682
-------------+----------------------------------------------------------------
       alpha |   .2391802    .013406                      .2142966    .2669531
------------------------------------------------------------------------------

Simulating main parameters.  Please wait....
% of simulations completed: 1% 3% 5% 7% 9% 10% 12% 14% 16% 18% 20% 21% 23% 25% 27% 29% 30% 32% 34% 36% 38% 40%
>  41% 43% 45% 47% 49% 50% 52% 54% 56% 58% 60% 61% 63% 65% 67% 69% 70% 72% 74% 76% 78% 80% 81% 83% 85% 87% 89%
>  90% 92% 94% 96% 98% 100% 

Number of simulations  : 1000
Names of new variables : b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 b18 b19 b20 b21 b22 b23 b2
> 4 b25 b26 b27 b28 b29 b30 b31 b32 b33 b34 b35 b36 b37 b38 b39 b40 b41 b42 b43 b44 b45 b46 b47 b48 b49 b50 b5
> 1 b52 b53 b54 b55

. quietly generate dropb=.

. order dropb

. setx mean

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk1 0 dkhsd1 0 dpakd1 0 dlabd1 0 dindd1 0 daidd1 0 
> dqabd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. local hbase=r(mean)

. quietly drop expval

. setx ddowk6 0 dhm01 1 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk1 0 dkhsd1 0 dpakd1 0 dlabd1 0 dindd1 0 daidd1 0 
> dqabd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Muharram"
. display (r(mean)-`hbase')/`hbase'
-.1367595

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 1 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk1 0 dkhsd1 0 dpakd1 0 dlabd1 0 dindd1 0 daidd1 0 
> dqabd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Dhu al-Hijja"
. display (r(mean)-`hbase')/`hbase'
-.07988735

. *
. quietly drop expval

. setx ddowk6 0 dhm01 1 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 1 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk1 0 dkhsd1 0 dpakd1 0 dlabd1 0 dindd1 0 daidd1 0 
> dqabd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Day of Ashura"
. display (r(mean)-`hbase')/`hbase'
-.62838665

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 1 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk1 0 dkhsd1 0 dpakd1 0 dlabd1 0 dindd1 0 daidd1 0 
> dqabd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Mawlid an Nabi (Sunni)"
. display (r(mean)-`hbase')/`hbase'
-.50215135

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 1 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 1 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 0 ddowk1 0 dkhsd1 0 dpakd1 0 dlabd1 0 dindd1 0 daidd1 0 
> dqabd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "First Day of Ramadan"
. display (r(mean)-`hbase')/`hbase'
-.29004485

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 0 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 1 ddoar1 0 deida4 0 ddowk1 0 dkhsd1 0 dpakd1 0 dlabd1 0 dindd1 0 daidd1 0 
> dqabd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Eid al-Fitr (3 Day)"
. display (r(mean)-`hbase')/`hbase'
-.29943854

. *
. quietly drop expval

. setx ddowk6 0 dhm01 0 dhm07 0 dhm09 0 dhm11 0 dhm12 1 dahny1 0 ddoas1 0 dmanu1 0 dmanh1 0 disam1 0 dlyab1 0 
> dfdor1 0 dlaqh1 0 dlaqu1 0 deidf3 0 ddoar1 0 deida4 1 ddowk1 0 dkhsd1 0 dpakd1 0 dlabd1 0 dindd1 0 daidd1 0 
> dqabd1 0

. quietly simqi, genev(expval)

. quietly sum expval, detail

. *% Shift from "All Other Days" Baseline to "Eid al-Ahda (3 Day)"
. display (r(mean)-`hbase')/`hbase'
-.30542734

. *
. quietly drop expval

. quietly drop dropb-drope

. 
. clear matrix

. log close
      name:  <unnamed>
       log:  C:\data\RRP-APSR-Replication-2017-04-04\RRP-APSR-ReplicationCode-Main-2017-04-04.log
  log type:  text
 closed on:   4 Apr 2017, 23:14:48
--------------------------------------------------------------------------------------------------------------
